Skip to content

Commit

Permalink
Add type for errors accessing file on filesystem.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkocher committed Jan 9, 2025
1 parent 402aa17 commit f603839
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/ch/cyberduck/core/Local.java
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ public String toURL() {


public InputStream getInputStream() throws AccessDeniedException {
return getInputStream(path);
return this.getInputStream(path);
}

protected InputStream getInputStream(final String path) throws AccessDeniedException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import ch.cyberduck.core.exception.ConnectionCanceledException;
import ch.cyberduck.core.exception.ConnectionRefusedException;
import ch.cyberduck.core.exception.ConnectionTimeoutException;
import ch.cyberduck.core.exception.LocalAccessDeniedException;
import ch.cyberduck.core.exception.LocalNotfoundException;
import ch.cyberduck.core.exception.LoginFailureException;
import ch.cyberduck.core.exception.QuotaException;
import ch.cyberduck.core.exception.ResolveFailedException;
Expand Down Expand Up @@ -100,6 +102,10 @@ public Type determine(final BackgroundException failure) {
if(cause instanceof AntiVirusAccessDeniedException) {
return Type.antivirus;
}
if(cause instanceof LocalAccessDeniedException
|| cause instanceof LocalNotfoundException) {
return Type.filesystem;
}
}
return Type.application;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ enum Type {
/**
* Scanner denied access to file
*/
antivirus
antivirus,
/**
* Accessing local file
*/
filesystem
}

Type determine(T failure);
Expand Down

0 comments on commit f603839

Please sign in to comment.