Skip to content

Commit

Permalink
Simplify AfsException enum
Browse files Browse the repository at this point in the history
  • Loading branch information
brianv0 committed Mar 29, 2017
1 parent 098eefd commit a069bee
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions vfs/src/main/java/org/srs/vfs/AbstractFsProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,12 @@ public FileStore getFileStore(Path path) throws IOException{
}

public static enum AfsException {
ACCESS_DENIED(AccessDeniedException.class),
NO_SUCH_FILE(NoSuchFileException.class),
NOT_DIRECTORY(NotDirectoryException.class),
DIRECTORY_NOT_EMPTY(DirectoryNotEmptyException.class),
FILE_EXISTS(FileAlreadyExistsException.class),
GENERIC(FileSystemException.class);

private final Class<? extends FileSystemException> exceptionClass;

private AfsException(Class<? extends FileSystemException> exceptionClass){
this.exceptionClass = exceptionClass;
}
ACCESS_DENIED,
NO_SUCH_FILE,
NOT_DIRECTORY,
DIRECTORY_NOT_EMPTY,
FILE_EXISTS,
GENERIC;

/*
TODO: Untested and unused
Expand Down Expand Up @@ -140,7 +134,7 @@ public String getReason(){
public String getMessage(){
return msg;
}

}

private static class ContainerNotEmptyException extends DirectoryNotEmptyException {
Expand Down

0 comments on commit a069bee

Please sign in to comment.