Package pro.gravit.utils.helper
Class IOHelper
java.lang.Object
pro.gravit.utils.helper.IOHelper
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Charsetstatic final intstatic final Stringstatic final FileSystemstatic final Pathstatic final intstatic final Pathstatic final intstatic final longstatic final Stringstatic final booleanstatic final intstatic final Charsetstatic final Stringstatic final Path -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclose(InputStream in) static voidclose(OutputStream out) static voidclose(AutoCloseable closeable) static URLconvertToURL(String url) static voidstatic voidcreateParentDirs(Path path) static Stringdecode(byte[] bytes) static StringdecodeASCII(byte[] bytes) static voidstatic byte[]static byte[]static booleanstatic PathgetCodeSource(Class<?> clazz) static StringgetFileName(Path path) static StringgetIP(SocketAddress address) static byte[]getResourceBytes(String name) static URLgetResourceURL(String name) static PathgetRoot()static booleanhasExtension(Path file, String extension) static booleanstatic booleanstatic booleanstatic booleanisValidFileName(String fileName) static booleanisValidPath(String path) static booleanisValidTextureBounds(int width, int height, boolean cloak) static voidstatic byte[]static BufferedInputStreamnewBufferedInput(URL url) static InputStreamnewBufferedInput(Path file) static OutputStreamnewBufferedOutput(Path file) static OutputStreamnewBufferedOutput(Path file, boolean append) static ByteArrayOutputStreamstatic char[]static URLConnectionnewConnection(URL url) static HttpURLConnectionnewConnectionPost(URL url) static Deflaterstatic Inflaterstatic InputStreamstatic InputStreamstatic OutputStreamstatic OutputStreamstatic BufferedReadernewReader(InputStream input) static BufferedReadernewReader(InputStream input, Charset charset) static BufferedReaderstatic BufferedReaderstatic Socketstatic BufferedWriterstatic BufferedWriternewWriter(OutputStream output) static BufferedWriterstatic BufferedWriterstatic ZipEntrynewZipEntry(String name) static ZipEntrynewZipEntry(ZipEntry entry) static ZipInputStreamnewZipInput(InputStream input) static ZipInputStreamnewZipInput(URL url) static ZipInputStreamnewZipInput(Path file) static InputStreamstatic OutputStreamnonClosing(OutputStream out) static byte[]read(InputStream input) static voidread(InputStream input, byte[] bytes) static byte[]static byte[]static BasicFileAttributesreadAttributes(Path path) static voidreadTexture(Object input, boolean cloak) static Stringstatic InetSocketAddressresolve(InetSocketAddress address) static PathresolveIncremental(Path dir, String name, String extension) static PathresolveJavaBin(Path javaDir) static PathresolveJavaBin(Path javaDir, boolean isConsole) static voidsetSocketFlags(Socket socket) static Pathstatic StringtoAbsPathString(Path path) static byte[]static Pathstatic Stringstatic URIstatic URLstatic voidstatic longtransfer(InputStream input, OutputStream output) static voidtransfer(InputStream input, Path file) static longtransfer(InputStream input, Path file, boolean append) static voidtransfer(Path file, OutputStream output) static Stringstatic Stringstatic StringverifyFileName(String fileName) static intverifyLength(int length, int max) static BufferedImageverifyTexture(BufferedImage skin, boolean cloak) static Stringstatic voidwalk(Path dir, FileVisitor<Path> visitor, boolean hidden) static void
-
Field Details
-
MB32
public static final long MB32- See Also:
-
UNICODE_CHARSET
-
ASCII_CHARSET
-
MAX_BATCH_SIZE
public static final int MAX_BATCH_SIZE- See Also:
-
SOCKET_TIMEOUT
public static final int SOCKET_TIMEOUT -
HTTP_TIMEOUT
public static final int HTTP_TIMEOUT -
BUFFER_SIZE
public static final int BUFFER_SIZE -
CROSS_SEPARATOR
- See Also:
-
FS
-
PLATFORM_SEPARATOR
-
POSIX
public static final boolean POSIX -
JVM_DIR
-
HOME_DIR
-
WORKING_DIR
-
USER_AGENT
-
-
Method Details
-
close
-
close
-
close
-
convertToURL
-
copy
- Throws:
IOException
-
createParentDirs
- Throws:
IOException
-
decode
-
decodeASCII
-
deleteDir
- Throws:
IOException
-
encode
-
encodeASCII
-
exists
-
getCodeSource
-
getFileName
-
getIP
-
getRoot
-
getResourceBytes
- Throws:
IOException
-
getResourceURL
- Throws:
NoSuchFileException
-
hasExtension
-
isDir
-
isEmpty
- Throws:
IOException
-
isFile
-
isValidFileName
-
isValidPath
-
isValidTextureBounds
public static boolean isValidTextureBounds(int width, int height, boolean cloak) -
move
- Throws:
IOException
-
newBuffer
public static byte[] newBuffer() -
newByteArrayOutput
-
newCharBuffer
public static char[] newCharBuffer() -
newConnection
- Throws:
IOException
-
newConnectionPost
- Throws:
IOException
-
newDeflater
-
newInflater
-
newInput
- Throws:
IOException
-
newBufferedInput
- Throws:
IOException
-
newInput
- Throws:
IOException
-
newBufferedInput
- Throws:
IOException
-
newOutput
- Throws:
IOException
-
newBufferedOutput
- Throws:
IOException
-
newOutput
- Throws:
IOException
-
newBufferedOutput
- Throws:
IOException
-
newReader
-
newReader
-
newReader
- Throws:
IOException
-
newReader
- Throws:
IOException
-
newSocket
- Throws:
SocketException
-
newWriter
-
newWriter
-
newWriter
- Throws:
IOException
-
newWriter
- Throws:
IOException
-
newZipEntry
-
newZipEntry
-
newZipInput
-
newZipInput
- Throws:
IOException
-
newZipInput
- Throws:
IOException
-
read
- Throws:
IOException
-
read
- Throws:
IOException
-
read
- Throws:
IOException
-
read
- Throws:
IOException
-
readAttributes
- Throws:
IOException
-
readTexture
- Throws:
IOException
-
request
- Throws:
IOException
-
resolve
-
resolveIncremental
-
resolveJavaBin
-
resolveJavaBin
-
setSocketFlags
- Throws:
SocketException
-
toAbsPathString
-
toAbsPath
-
toByteArray
- Throws:
IOException
-
toPath
-
toString
-
toURI
-
toURL
-
transfer
- Throws:
IOException
-
transfer
- Throws:
IOException
-
transfer
- Throws:
IOException
-
transfer
- Throws:
IOException
-
transfer
- Throws:
IOException
-
urlDecode
-
urlEncode
-
verifyFileName
-
verifyLength
- Throws:
IOException
-
verifyTexture
-
verifyURL
-
walk
- Throws:
IOException
-
write
- Throws:
IOException
-
nonClosing
-
nonClosing
-