litesoft
Diff Revisions
973
vs
974
for /trunk/Java/ScarPlus/src/com/esotericsoftware/filesystem/RootedPaths.java
|
@@ -31,10 +31,11 @@ |
31 |
31 |
|
return mCanonicalRelativePaths.size(); |
32 |
32 |
|
} |
33 |
33 |
|
|
34 |
|
- |
public void collectPaths( List<FilePath> pPaths ) { |
|
34 |
+ |
public List<FilePath> collectPaths( List<FilePath> pPaths ) { |
35 |
35 |
|
for ( String zPath : mCanonicalRelativePaths ) { |
36 |
36 |
|
pPaths.add( FilePath.canonical( mCanonicalRootDirectory, zPath ) ); |
37 |
37 |
|
} |
|
38 |
+ |
return pPaths; |
38 |
39 |
|
} |
39 |
40 |
|
|
40 |
41 |
|
@Override |
|
@@ -57,4 +58,23 @@ |
57 |
58 |
|
this.mGreatestLastModified = Math.max( this.mGreatestLastModified, them.mGreatestLastModified ); |
58 |
59 |
|
this.mCanonicalRelativePaths.addAll( them.mCanonicalRelativePaths ); |
59 |
60 |
|
} |
|
61 |
+ |
|
|
62 |
+ |
@Override |
|
63 |
+ |
public String toString() { |
|
64 |
+ |
if ( mCanonicalRelativePaths.isEmpty() ) { |
|
65 |
+ |
return ""; |
|
66 |
+ |
} |
|
67 |
+ |
List<FilePath> zPaths = collectPaths( new ArrayList<FilePath>() ); |
|
68 |
+ |
if ( zPaths.size() == 1 ) { |
|
69 |
+ |
return zPaths.get( 0 ).canonical(); |
|
70 |
+ |
} |
|
71 |
+ |
StringBuilder sb = new StringBuilder(); |
|
72 |
+ |
for ( FilePath zPath : zPaths ) { |
|
73 |
+ |
if ( sb.length() != 0 ) { |
|
74 |
+ |
sb.append( ",\n" ); |
|
75 |
+ |
} |
|
76 |
+ |
sb.append( " " ).append( zPath.canonical() ); |
|
77 |
+ |
} |
|
78 |
+ |
return sb.toString(); |
|
79 |
+ |
} |
60 |
80 |
|
} |