Skip to content

Commit

Permalink
Fixed describeLocations for ZipResourceAccessor
Browse files Browse the repository at this point in the history
  • Loading branch information
nvoxland committed Oct 11, 2022
1 parent a062f97 commit 40530c0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URI;
import java.nio.file.*;
import java.util.Collections;
import java.util.List;

public class ZipResourceAccessor extends AbstractPathResourceAccessor {

Expand Down Expand Up @@ -64,4 +64,8 @@ protected Resource createResource(Path file, String pathToAdd) {
return new PathResource(pathToAdd, file);
}

@Override
public List<String> describeLocations() {
return Collections.singletonList(fileSystem.toString());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,10 @@ class ZipResourceAccessorTest extends Specification {
]
}

def describeLocations() {
expect:
simpleTestAccessor.describeLocations().size() == 1
simpleTestAccessor.describeLocations()[0].replace("\\", "/").endsWith("target/test-classes/simple-files.jar")
}

}

0 comments on commit 40530c0

Please sign in to comment.