Class IOUtils
java.lang.Object
net.thevpc.common.io.IOUtils
- Author:
- taha.bensalah@gmail.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final inttaille par defaut du buffer de transferstatic final OutputStreamstatic final PrintStream -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcomputeCRC(byte[] bytes) static StringcomputeCRC(File file) static Stringstatic StringcomputeCRC(Reader reader) static StringconcatPath(char separator, String... paths) static voidcopy le flux d'entree dans le lux de sortiestatic voidstatic voidcopy streamstatic voidcopy(File in, OutputStream out) copy le flux d'entree dans le lux de sortiestatic voidcopy(File from, OutputStream to, boolean closeOutput) static voidcopy(File in, OutputStream out, int bufferSize) copy streamstatic voidcopy(InputStream in, File out) copy le flux d'entree dans le lux de sortiestatic voidcopy(InputStream from, File to, boolean mkdirs, boolean closeInput) static voidcopy(InputStream from, File to, boolean mkdirs, boolean closeInput, FileValidator validator) static voidcopy(InputStream in, File out, int bufferSize) copy le flux d'entree dans le lux de sortiestatic voidcopy(InputStream in, OutputStream out) copy le flux d'entree dans le lux de sortiestatic longcopy(InputStream from, OutputStream to, boolean closeInput, boolean closeOutput) static longcopy(InputStream from, OutputStream to, boolean closeInput, boolean closeOutput, StopMonitor monitor) static voidcopy(InputStream in, OutputStream out, int bufferSize) copy le flux d'entree dans le lux de sortiestatic voidcopy(Reader from, OutputStream to, boolean closeInput, boolean closeOutput) static voidstatic voidstatic voidstatic longcopy(NonBlockingInputStream from, OutputStream to, boolean closeInput, boolean closeOutput, StopMonitor monitor) static DeleteResultstatic DeleteResultfilterExceptions(InputStreamSource is, boolean trackChanges) static PathInfogetPathInfo(File path) static PathInfogetPathInfo(String path) static PathInfogetPathInfo(URL path) static booleanstatic byte[]loadByteArray(File stream) static byte[]loadByteArray(File stream, int maxSize) static byte[]static byte[]loadByteArray(InputStream stream, boolean close) static byte[]loadByteArray(InputStream stream, int maxSize, boolean close) static byte[]loadByteArray(URL url) static char[]static char[]static char[]static ObjectloadObject(String physicalName) static ObjectloadObject2(String physicalName) static PropertiesloadProperties(File file) static PropertiesloadProperties(File file, boolean silent) static PropertiesloadProperties(URL url) static PropertiesloadProperties(Path is) static Propertiesstatic StringloadString(File is) static Stringstatic StringloadString(InputStream stream, boolean close) static StringloadString(Reader r) static StringloadString(URL url) static Stringstatic String[]static PropertiesloadURLProperties(String url) static PropertiesloadURLProperties(URL url) static PropertiesloadXMLProperties(File file) static Propertiesstatic ObjectloadZippedObject(String physicalName) static InputStreammonitor(InputStream from, Object source, String sourceName, long length, InputStreamMonitor monitor) static InputStreammonitor(URL from, InputStreamMonitor monitor) static PipeThreadpipe(String name, NonBlockingInputStream in, OutputStream out) static voidsaveObject(String physicalName, Object object) static voidsaveObject2(String physicalName, Object object) static voidsaveProperties(Properties p, String comments, File file) static voidsaveProperties(Properties p, String comments, Path file) static voidsaveString(String message, File file) static voidsaveString(String string, String physicalName) writeString writeToFilestatic voidsaveXMLProperties(Properties p, String comments, File file) static InputStreamSourcetoInputStreamSource(byte[] bytes) static InputStreamSourcetoInputStreamSource(byte[] bytes, String name) static InputStreamSourcetoInputStreamSource(File file) static InputStreamSourcetoInputStreamSource(InputStream stream) static InputStreamSourcetoInputStreamSource(InputStream inputStream, String name) static InputStreamSourcetoInputStreamSource(Object anyObject, String variant, String optionalName, File cwd) static InputStreamSourcetoInputStreamSource(String string) static InputStreamSourcetoInputStreamSource(String path, String variant, String name, File cwd) static InputStreamSourcetoInputStreamSource(URL url) static InputStreamSourcetoInputStreamSource(Path path) static OutputStreamSourcetoOutputStreamSource(File file) toStringIterable(InputStreamSource is, boolean trackChanges)
-
Field Details
-
NULL_OUTPUT_STREAM
-
NULL_PRINT_STREAM
-
DEFAULT_BUFFER_SIZE
public static final int DEFAULT_BUFFER_SIZEtaille par defaut du buffer de transfer- See Also:
-
-
Constructor Details
-
IOUtils
public IOUtils()
-
-
Method Details
-
toStringIterable
-
filterExceptions
-
loadStringArray
- Throws:
IOException
-
loadProperties
- Throws:
IOException
-
loadProperties
- Throws:
IOException
-
loadXMLProperties
- Throws:
IOException
-
loadString
- Throws:
IOException
-
loadString
- Throws:
IOException
-
loadCharArray
- Throws:
IOException
-
loadCharArray
- Throws:
IOException
-
loadString
- Throws:
IOException
-
loadCharArray
- Throws:
IOException
-
toOutputStreamSource
-
toInputStreamSource
-
toInputStreamSource
-
toInputStreamSource
-
toInputStreamSource
-
toInputStreamSource
-
toInputStreamSource
-
toInputStreamSource
-
loadObject2
-
loadObject
- Throws:
IOExceptionClassNotFoundException
-
loadZippedObject
public static Object loadZippedObject(String physicalName) throws IOException, ClassNotFoundException - Throws:
IOExceptionClassNotFoundException
-
loadString
- Throws:
IOException
-
loadString
- Throws:
IOException
-
loadByteArray
- Throws:
IOException
-
saveXMLProperties
- Throws:
IOException
-
saveString
- Throws:
IOException
-
saveProperties
- Throws:
IOException
-
saveProperties
- Throws:
IOException
-
loadXMLProperties
- Throws:
IOException
-
loadProperties
- Throws:
IOException
-
loadProperties
- Throws:
IOException
-
copy
copy le flux d'entree dans le lux de sortie- Parameters:
in- entreeout- sortie- Throws:
IOException- when IO error
-
copy
copy le flux d'entree dans le lux de sortie- Parameters:
in- inputout- outputbufferSize- bufferSize- Throws:
IOException- when IO error
-
copy
copy le flux d'entree dans le lux de sortie- Parameters:
in- entreeout- sortie- Throws:
IOException- when IO error
-
copy
copy stream- Parameters:
in- inputout- outputbufferSize- bufferSize- Throws:
IOException- when IO error
-
copy
copy le flux d'entree dans le lux de sortie- Parameters:
in- entreeout- sortie- Throws:
IOException- when IO error
-
copy
copy stream- Parameters:
in- inputout- outputbufferSize- bufferSize- Throws:
IOException- when IO error
-
copy
copy le flux d'entree dans le lux de sortie- Parameters:
in- entreeout- sortie- Throws:
IOException- when IO error
-
copy
- Throws:
IOException
-
copy
copy le flux d'entree dans le lux de sortie- Parameters:
in- entreeout- sortiebufferSize- bufferSize- Throws:
IOException- when IO error
-
saveObject2
-
saveObject
- Throws:
IOException
-
saveString
writeString writeToFile- Parameters:
string- value to savephysicalName- file path- Throws:
IOException- IOException
-
computeCRC
- Throws:
IOException
-
computeCRC
- Throws:
IOException
-
computeCRC
- Throws:
IOException
-
computeCRC
- Throws:
IOException
-
toInputStreamSource
public static InputStreamSource toInputStreamSource(Object anyObject, String variant, String optionalName, File cwd) throws IOException - Throws:
IOException
-
toInputStreamSource
public static InputStreamSource toInputStreamSource(String path, String variant, String name, File cwd) throws IOException - Throws:
IOException
-
toInputStreamSource
public static InputStreamSource toInputStreamSource(InputStream inputStream, String name) throws IOException - Throws:
IOException
-
loadByteArray
- Throws:
IOException
-
loadByteArray
public static byte[] loadByteArray(InputStream stream, int maxSize, boolean close) throws IOException - Throws:
IOException
-
copy
- Throws:
IOException
-
copy
- Throws:
IOException
-
copy
public static void copy(Reader from, OutputStream to, boolean closeInput, boolean closeOutput) throws IOException - Throws:
IOException
-
copy
- Throws:
IOException
-
copy
- Throws:
IOException
-
copy
public static void copy(InputStream from, File to, boolean mkdirs, boolean closeInput) throws IOException - Throws:
IOException
-
copy
public static void copy(InputStream from, File to, boolean mkdirs, boolean closeInput, FileValidator validator) throws IOException - Throws:
IOException
-
copy
public static long copy(InputStream from, OutputStream to, boolean closeInput, boolean closeOutput) throws IOException - Throws:
IOException
-
copy
public static long copy(InputStream from, OutputStream to, boolean closeInput, boolean closeOutput, StopMonitor monitor) throws IOException - Throws:
IOException
-
copy
public static long copy(NonBlockingInputStream from, OutputStream to, boolean closeInput, boolean closeOutput, StopMonitor monitor) throws IOException - Throws:
IOException
-
loadString
- Throws:
IOException
-
loadByteArray
- Throws:
IOException
-
loadProperties
- Throws:
IOException
-
isValidInputStreamSource
-
loadByteArray
- Throws:
IOException
-
pipe
-
monitor
- Throws:
IOException
-
monitor
public static InputStream monitor(InputStream from, Object source, String sourceName, long length, InputStreamMonitor monitor) -
loadURLProperties
-
loadURLProperties
-
delete
- Throws:
IOException
-
delete
- Throws:
IOException
-
loadByteArray
- Throws:
IOException
-
getPathInfo
-
getPathInfo
-
getPathInfo
-
concatPath
-