From 98cef5e9a772602d42acfcf233838c760424db9a Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Thu, 13 Feb 2025 18:00:17 +1100 Subject: initial commit --- comp2511/blackout/FileTransferException.java | 48 ++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 comp2511/blackout/FileTransferException.java (limited to 'comp2511/blackout/FileTransferException.java') 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); + } + } +} -- cgit v1.2.3