File tree Expand file tree Collapse file tree
testingapps/thepulper/src/main/java/com/javafortesters/pulp/reader Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,16 +42,17 @@ v1.4 - split into multiple pom.xnl
4242 moved to 1.2 snapshot to work on a v1 to v2 toggle where v2 has ids, classes etc for automating
4343 version 1.2.0 pulper 4 different versions, with help file
4444 version 1.2.1 pulper v5 has an XHTTP request on author create
45+ 1.2.2 has operating system independent resource loading i.e. it didn't work on windows
4546 -->
46- <thepulper .version>1-2-1 </thepulper .version>
47+ <thepulper .version>1-2-2 </thepulper .version>
4748
4849 <!-- COLLECTED APPS -->
4950 <!-- 1-2-0 has the pulper with CRUD and formatting-->
5051 <!-- 1-3-0 has the pulper with 4 switchable versions with different capabilities as shown in help file-->
5152 <!-- 1-3-1 has the pulper with v5 - fetch javascript create on author
5253 and Selenium Test pages has the search engine page fix for cookies
5354 -->
54- <collectedapp .version>1-3-1 </collectedapp .version>
55+ <collectedapp .version>1-3-2 </collectedapp .version>
5556
5657
5758 <herokumaven .version>1.2.0</herokumaven .version>
Original file line number Diff line number Diff line change @@ -11,7 +11,11 @@ public CsvReader(String resourcePath) {
1111
1212 public void read () {
1313 this .data = new ResourceReader ().asString (resourcePath );
14- this .lines = data .split ("\n " );
14+ String splitter = "\n " ;
15+ if (data .contains ("\r \n " )){
16+ splitter = "\r \n " ;
17+ }
18+ this .lines = data .split (splitter );
1519 }
1620
1721 public int numberOfLines () {
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ public class ResourceReader {
1212 public String asString (String resourceName ){
1313
1414 try {
15- InputStream in = this .getClass ().getResourceAsStream (resourceName );
15+ InputStream in = this .getClass ().getResourceAsStream (osIndependentResourcePath ( resourceName ) );
1616
1717 // http://web.archive.org/web/20140531042945/https://weblogs.java.net/blog/pat/archive/2004/10/stupid_scanner_1.html
1818 Scanner scanner = new Scanner (in ).useDelimiter ("\\ A" );
@@ -29,10 +29,14 @@ public String asString(String resourceName){
2929 }
3030 }
3131
32+ private String osIndependentResourcePath (String path ){
33+ return path .replaceAll ("\\ \\ " ,"/" );
34+ }
35+
3236 public boolean doesResourceExist (final String path ) {
3337 try {
3438
35- InputStream in = this .getClass ().getResourceAsStream (path );
39+ InputStream in = this .getClass ().getResourceAsStream (osIndependentResourcePath ( path ) );
3640 if (in ==null ){
3741 return false ;
3842 }
You can’t perform that action at this time.
0 commit comments