-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ErrorResource.toStatus() handles AccessDeniedException (closes #321)
- Loading branch information
Alex Dolski
committed
Sep 23, 2019
1 parent
0ee7c4a
commit 6face3c
Showing
9 changed files
with
89 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/test/java/edu/illinois/library/cantaloupe/source/AccessDeniedSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package edu.illinois.library.cantaloupe.source; | ||
|
||
import edu.illinois.library.cantaloupe.image.Format; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.AccessDeniedException; | ||
import java.nio.file.Path; | ||
|
||
public class AccessDeniedSource extends AbstractSource implements FileSource { | ||
|
||
@Override | ||
public void checkAccess() throws IOException { | ||
throw new AccessDeniedException(""); | ||
} | ||
|
||
@Override | ||
public Format getFormat() throws IOException { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Path getPath() throws IOException { | ||
return null; | ||
} | ||
|
||
} |