@@ -439,7 +439,7 @@ private BaseEntry getEntry(Path inputPath) throws IOException {
439
439
warn ("VFS.getEntry: no entries after init" );
440
440
}
441
441
}
442
- Path path = resolveVFSRelative (inputPath );
442
+ Path path = toAbsolutePathInternal (inputPath );
443
443
return vfsEntries .get (toCaseComparable (path .toString ()));
444
444
}
445
445
@@ -618,7 +618,7 @@ public void checkAccess(Path p, Set<? extends AccessMode> modes, LinkOption... l
618
618
Objects .requireNonNull (p );
619
619
Objects .requireNonNull (modes );
620
620
621
- Path path = resolveVFSRelative (p );
621
+ Path path = toAbsolutePathInternal (p );
622
622
if (!pathIsInVfs (path )) {
623
623
boolean passed = false ;
624
624
try {
@@ -647,7 +647,7 @@ public void createDirectory(Path d, FileAttribute<?>... attrs) throws IOExceptio
647
647
Objects .requireNonNull (d );
648
648
Objects .requireNonNull (attrs );
649
649
650
- Path dir = resolveVFSRelative (d );
650
+ Path dir = toAbsolutePathInternal (d );
651
651
if (!pathIsInVfs (dir )) {
652
652
boolean passed = false ;
653
653
try {
@@ -666,7 +666,7 @@ public void createDirectory(Path d, FileAttribute<?>... attrs) throws IOExceptio
666
666
public void delete (Path p ) throws IOException {
667
667
Objects .requireNonNull (p );
668
668
669
- Path path = resolveVFSRelative (p );
669
+ Path path = toAbsolutePathInternal (p );
670
670
if (!pathIsInVfs (path )) {
671
671
boolean passed = false ;
672
672
try {
@@ -687,7 +687,7 @@ public SeekableByteChannel newByteChannel(Path p, Set<? extends OpenOption> opti
687
687
Objects .requireNonNull (options );
688
688
Objects .requireNonNull (attrs );
689
689
690
- Path path = resolveVFSRelative (p );
690
+ Path path = toAbsolutePathInternal (p );
691
691
if (!pathIsInVfs (path )) {
692
692
boolean passed = false ;
693
693
try {
@@ -781,7 +781,7 @@ public void close() throws IOException {
781
781
@ Override
782
782
public DirectoryStream <Path > newDirectoryStream (Path d , DirectoryStream .Filter <? super Path > filter ) throws IOException {
783
783
Objects .requireNonNull (d );
784
- Path dir = resolveVFSRelative (d );
784
+ Path dir = toAbsolutePathInternal (d );
785
785
if (!pathIsInVfs (dir )) {
786
786
boolean passed = false ;
787
787
try {
@@ -823,7 +823,7 @@ public Iterator<Path> iterator() {
823
823
}
824
824
}
825
825
826
- private Path resolveVFSRelative (Path path ) {
826
+ private Path toAbsolutePathInternal (Path path ) {
827
827
if (path .isAbsolute ()) {
828
828
return path .normalize ();
829
829
}
@@ -837,7 +837,7 @@ private Path resolveVFSRelative(Path path) {
837
837
@ Override
838
838
public Path toAbsolutePath (Path path ) {
839
839
Objects .requireNonNull (path );
840
- Path result = resolveVFSRelative (path );
840
+ Path result = toAbsolutePathInternal (path );
841
841
if (!pathIsInVfs (result )) {
842
842
if (allowHostIO == NONE ) {
843
843
delegate .toAbsolutePath (path );
@@ -860,7 +860,7 @@ public Path toAbsolutePath(Path path) {
860
860
public Path toRealPath (Path p , LinkOption ... linkOptions ) throws IOException {
861
861
Objects .requireNonNull (p );
862
862
863
- Path path = resolveVFSRelative (p );
863
+ Path path = toAbsolutePathInternal (p );
864
864
boolean pathIsInVFS = pathIsInVfs (path );
865
865
if (!pathIsInVFS ) {
866
866
Path ret = delegate .toRealPath (path , linkOptions );
@@ -884,7 +884,7 @@ public Path toRealPath(Path p, LinkOption... linkOptions) throws IOException {
884
884
public Map <String , Object > readAttributes (Path p , String attributes , LinkOption ... options ) throws IOException {
885
885
Objects .requireNonNull (p );
886
886
887
- Path path = resolveVFSRelative (p );
887
+ Path path = toAbsolutePathInternal (p );
888
888
if (!pathIsInVfs (path )) {
889
889
Map <String , Object > ret = delegate .readAttributes (path , attributes , options );
890
890
finest ("VFS.readAttributes delegated '%s' -> '%s'" , path , ret );
@@ -955,8 +955,8 @@ public void copy(Path s, Path t, CopyOption... options) throws IOException {
955
955
Objects .requireNonNull (s );
956
956
Objects .requireNonNull (t );
957
957
958
- Path source = resolveVFSRelative (s );
959
- Path target = resolveVFSRelative (t );
958
+ Path source = toAbsolutePathInternal (s );
959
+ Path target = toAbsolutePathInternal (t );
960
960
if (pathIsInVfs (target )) {
961
961
String msg = String .format ("read-only filesystem, can't copy %s -> %s" , source , target );
962
962
finer ("VFS.move %s" , msg );
@@ -974,8 +974,8 @@ public void copy(Path s, Path t, CopyOption... options) throws IOException {
974
974
public void move (Path s , Path t , CopyOption ... options ) throws IOException {
975
975
Objects .requireNonNull (s );
976
976
Objects .requireNonNull (t );
977
- Path source = resolveVFSRelative (s );
978
- Path target = resolveVFSRelative (t );
977
+ Path source = toAbsolutePathInternal (s );
978
+ Path target = toAbsolutePathInternal (t );
979
979
if (!pathIsInVfs (source ) && !pathIsInVfs (target )) {
980
980
delegate .move (source , target , options );
981
981
} else {
@@ -988,7 +988,7 @@ public void move(Path s, Path t, CopyOption... options) throws IOException {
988
988
@ Override
989
989
public Charset getEncoding (Path p ) {
990
990
Objects .requireNonNull (p );
991
- Path path = resolveVFSRelative (p );
991
+ Path path = toAbsolutePathInternal (p );
992
992
if (!pathIsInVfs (path )) {
993
993
return delegate .getEncoding (path );
994
994
} else {
@@ -1000,8 +1000,8 @@ public Charset getEncoding(Path p) {
1000
1000
public void createSymbolicLink (Path l , Path t , FileAttribute <?>... attrs ) throws IOException {
1001
1001
Objects .requireNonNull (l );
1002
1002
Objects .requireNonNull (t );
1003
- Path link = resolveVFSRelative (l );
1004
- Path target = resolveVFSRelative (t );
1003
+ Path link = toAbsolutePathInternal (l );
1004
+ Path target = toAbsolutePathInternal (t );
1005
1005
if (!pathIsInVfs (link ) && !pathIsInVfs (target )) {
1006
1006
delegate .createSymbolicLink (link , target , attrs );
1007
1007
} else {
@@ -1015,8 +1015,8 @@ public void createSymbolicLink(Path l, Path t, FileAttribute<?>... attrs) throws
1015
1015
public void createLink (Path l , Path e ) throws IOException {
1016
1016
Objects .requireNonNull (l );
1017
1017
Objects .requireNonNull (e );
1018
- Path link = resolveVFSRelative (l );
1019
- Path existing = resolveVFSRelative (e );
1018
+ Path link = toAbsolutePathInternal (l );
1019
+ Path existing = toAbsolutePathInternal (e );
1020
1020
if (!pathIsInVfs (link ) && !pathIsInVfs (existing )) {
1021
1021
delegate .createLink (link , existing );
1022
1022
} else {
@@ -1029,7 +1029,7 @@ public void createLink(Path l, Path e) throws IOException {
1029
1029
@ Override
1030
1030
public Path readSymbolicLink (Path l ) throws IOException {
1031
1031
Objects .requireNonNull (l );
1032
- Path link = resolveVFSRelative (l );
1032
+ Path link = toAbsolutePathInternal (l );
1033
1033
if (!pathIsInVfs (link )) {
1034
1034
return delegate .readSymbolicLink (link );
1035
1035
} else {
@@ -1042,7 +1042,7 @@ public Path readSymbolicLink(Path l) throws IOException {
1042
1042
@ Override
1043
1043
public void setAttribute (Path p , String attribute , Object value , LinkOption ... options ) throws IOException {
1044
1044
Objects .requireNonNull (p );
1045
- Path path = resolveVFSRelative (p );
1045
+ Path path = toAbsolutePathInternal (p );
1046
1046
if (!pathIsInVfs (path )) {
1047
1047
delegate .setAttribute (path , attribute , value , options );
1048
1048
} else {
@@ -1055,7 +1055,7 @@ public void setAttribute(Path p, String attribute, Object value, LinkOption... o
1055
1055
@ Override
1056
1056
public String getMimeType (Path p ) {
1057
1057
Objects .requireNonNull (p );
1058
- Path path = resolveVFSRelative (p );
1058
+ Path path = toAbsolutePathInternal (p );
1059
1059
if (!pathIsInVfs (path )) {
1060
1060
return delegate .getMimeType (path );
1061
1061
}
0 commit comments