diff --git a/src/com/hippo/ehviewer/exception/FileException.java b/src/com/hippo/ehviewer/exception/FileException.java new file mode 100644 index 000000000..ce7b7ce70 --- /dev/null +++ b/src/com/hippo/ehviewer/exception/FileException.java @@ -0,0 +1,25 @@ +package com.hippo.ehviewer.exception; + +public class FileException extends Exception { + + public static final int MKDIR_ERROR = 0x0; + public static final int CREATE_FILE_ERROR = 0x1; + public static final int NOT_DIR = 0x2; + public static final int NOT_FILE = 0x3; + public static final int CANNOT_EXECUTE = 0x4; + public static final int CANNOT_READ = 0x5; + public static final int CANNOT_WRITE = 0x6; + + private int mErrorCode; + + private static final long serialVersionUID = 1L; + + public FileException(int errorCode) { + mErrorCode = errorCode; + } + + public int getErrorCode() { + return mErrorCode; + } + +} diff --git a/src/com/hippo/ehviewer/exception/NoSdCardException.java b/src/com/hippo/ehviewer/exception/NoSdCardException.java new file mode 100644 index 000000000..25cacff29 --- /dev/null +++ b/src/com/hippo/ehviewer/exception/NoSdCardException.java @@ -0,0 +1,5 @@ +package com.hippo.ehviewer.exception; + +public class NoSdCardException extends Exception { + private static final long serialVersionUID = 1L; +} diff --git a/src/com/hippo/ehviewer/network/Constant.java b/src/com/hippo/ehviewer/network/Constant.java new file mode 100644 index 000000000..227abb011 --- /dev/null +++ b/src/com/hippo/ehviewer/network/Constant.java @@ -0,0 +1,14 @@ +package com.hippo.ehviewer.network; + +public class Constant { + + public static final int HTTP_TEMP_REDIRECT = 307; + + public static String defaultUserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.76 Safari/537.36"; + public static String userAgent = System.getProperty("http.agent", defaultUserAgent); + public static final int DEFAULT_TIMEOUT = 5 * 1000; + public static final int MAX_REDIRECTS = 5; + + public static final int BUFFER_SIZE = 4096; + +}