diff options
| author | Nicolas James <Eele1Ephe7uZahRie@tutanota.com> | 2025-02-13 18:00:17 +1100 |
|---|---|---|
| committer | Nicolas James <Eele1Ephe7uZahRie@tutanota.com> | 2025-02-13 18:00:17 +1100 |
| commit | 98cef5e9a772602d42acfcf233838c760424db9a (patch) | |
| tree | 5277fa1d7cc0a69a0f166fcbf10fd320f345f049 /comp2511/blackout/FileTransferException.java | |
initial commit
Diffstat (limited to 'comp2511/blackout/FileTransferException.java')
| -rw-r--r-- | comp2511/blackout/FileTransferException.java | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/comp2511/blackout/FileTransferException.java b/comp2511/blackout/FileTransferException.java new file mode 100644 index 0000000..e40c136 --- /dev/null +++ b/comp2511/blackout/FileTransferException.java @@ -0,0 +1,48 @@ +package unsw.blackout; + +/** + * Represents an exception that occured because of a file transfer. + */ +public class FileTransferException extends Exception { + public FileTransferException(String message) { + super(message); + } + + /** + * Represents the case where the targeted file wasn't found on the source. + */ + public static class VirtualFileNotFoundException extends FileTransferException { + public VirtualFileNotFoundException(String message) { + super(message); + } + } + + /** + * Represents the case where the targeted file already existed on the target + * or was in the process of downloading. + */ + public static class VirtualFileAlreadyExistsException extends FileTransferException { + public VirtualFileAlreadyExistsException(String message) { + super(message); + } + } + + /** + * Represents the case when no more bandwidth exists for a satellite to + * be able to use for new devices. + */ + public static class VirtualFileNoBandwidthException extends FileTransferException { + public VirtualFileNoBandwidthException(String message) { + super(message); + } + } + + /** + * Occurs when a satellite runs out of space. + */ + public static class VirtualFileNoStorageSpaceException extends FileTransferException { + public VirtualFileNoStorageSpaceException(String message) { + super(message); + } + } +} |
