Skip to content

Commit

Permalink
Jaikiran's feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
dfuch committed Nov 15, 2024
1 parent 30d6f8d commit b128391
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,6 @@ public static class FilePublisher implements BodyPublisher {
private final long length;
private final Function<Path, InputStream> inputStreamSupplier;

private static String checkPathForDefaultFS(Path path) {
return path.toFile().getPath();
}

/**
* Factory for creating FilePublisher.
*/
Expand All @@ -242,8 +238,9 @@ public static FilePublisher create(Path path)
boolean defaultFS = true;

try {
checkPathForDefaultFS(path);
path.toFile().getPath();
} catch (UnsupportedOperationException uoe) {
// path not associated with the default file system provider
defaultFS = false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ public final class ResponseBodyHandlers {

private ResponseBodyHandlers() { }

private static final String checkPathForDefaultFS(Path path) {
return path.toFile().getPath();
}

/**
* A Path body handler.
*/
Expand Down Expand Up @@ -146,7 +142,7 @@ public static class FileDownloadBodyHandler implements BodyHandler<Path> {
public static FileDownloadBodyHandler create(Path directory,
List<OpenOption> openOptions) {
try {
checkPathForDefaultFS(directory);
directory.toFile().getPath();
} catch (UnsupportedOperationException uoe) {
// directory not associated with the default file system provider
throw new IllegalArgumentException("invalid path: " + directory, uoe);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,6 @@ public static PathSubscriber create(Path file,
this.options = options.stream().toArray(OpenOption[]::new);
}

private static boolean isDefaultFS(Path file) {
try {
file.toFile();
return true;
} catch (UnsupportedOperationException uoe) {
return false;
}
}

@Override
public void onSubscribe(Flow.Subscription subscription) {
Objects.requireNonNull(subscription);
Expand Down

0 comments on commit b128391

Please sign in to comment.