From e45db97a5406d6817dd5d02fe46c76a346d60770 Mon Sep 17 00:00:00 2001 From: seven332 Date: Sat, 5 Apr 2014 22:28:45 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=20json=20=E6=A3=80=E6=9F=A5=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ehviewer/exception/FileException.java | 25 +++++++++++++++++++ .../ehviewer/exception/NoSdCardException.java | 5 ++++ src/com/hippo/ehviewer/network/Constant.java | 14 +++++++++++ 3 files changed, 44 insertions(+) create mode 100644 src/com/hippo/ehviewer/exception/FileException.java create mode 100644 src/com/hippo/ehviewer/exception/NoSdCardException.java create mode 100644 src/com/hippo/ehviewer/network/Constant.java 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; + +}