Package com.gigaspaces.internal.io
Class BootIOUtils
java.lang.Object
com.gigaspaces.internal.io.BootIOUtils
This class provides a set of static utility methods used for I/O manipulations. (writing/reading
objects to and from streams)
- Version:
- 9.1.1
- Author:
- elip
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Runnablestatic voiddeleteRecursive(Path path) static InputStreamgetResourceAsStream(String resource) static InputStreamgetResourceAsStream(String resource, ClassLoader classLoader) static PathgetResourcePath(String resource) static PathgetResourcePath(String resource, ClassLoader classLoader) static booleanstatic booleanstatic booleanstatic java.util.stream.Stream<String>lines(InputStream inputStream) static java.util.stream.Stream<String>lines(InputStream inputStream, Charset charset) static File[]A replacement forFile.listFiles()that does not return nullstatic File[]listFiles(File dir, FileFilter filter) static File[]listFiles(File dir, FilenameFilter filter) static PropertiesloadProperties(InputStream stream) static PropertiesloadProperties(InputStream stream, String name) static PropertiesloadProperties(Path path) static Filestatic Filestatic LongparseStringAsBytes(String property) static Stringstatic Stringstatic Stringstatic StringreadAsString(Path path) static Propertiesstatic Stringstatic String[]static booleantryWaitFor(java.util.function.BooleanSupplier predicate, long timeout, long pollInterval) static booleanwaitFor(java.util.function.BooleanSupplier predicate, long timeout, long pollInterval) static StringwrapIpv6HostAddressIfNeeded(InetAddress hostAddress) static voidwriteMapStringString(ObjectOutput out, Map<String, String> map) static voidwriteProperties(ObjectOutput out, Properties properties) static voidwriteString(ObjectOutput out, String s) static voidwriteStringArray(ObjectOutput out, String[] array)
-
Field Details
-
UTF_MAX_LENGTH
public static final int UTF_MAX_LENGTH- See Also:
-
NEW_LINE
-
-
Constructor Details
-
BootIOUtils
public BootIOUtils()
-
-
Method Details
-
isEmpty
-
quoteIfContainsSpace
-
writeMapStringString
public static void writeMapStringString(ObjectOutput out, Map<String, String> map) throws IOException- Throws:
IOException
-
writeProperties
- Throws:
IOException
-
writeString
- Throws:
IOException
-
readMapStringString
public static Map<String,String> readMapStringString(ObjectInput in) throws IOException, ClassNotFoundException - Throws:
IOExceptionClassNotFoundException
-
readProperties
- Throws:
IOExceptionClassNotFoundException
-
readString
- Throws:
IOExceptionClassNotFoundException
-
readStringArray
- Throws:
IOExceptionClassNotFoundException
-
writeStringArray
- Throws:
IOException
-
listFiles
A replacement forFile.listFiles()that does not return null- Throws:
IllegalArgumentException- if not a directory or has no read permissions
-
listFiles
-
listFiles
-
wrapIpv6HostAddressIfNeeded
-
path
-
parseStringAsBytes
-
waitFor
public static boolean waitFor(java.util.function.BooleanSupplier predicate, long timeout, long pollInterval) throws InterruptedException - Throws:
InterruptedException
-
tryWaitFor
public static boolean tryWaitFor(java.util.function.BooleanSupplier predicate, long timeout, long pollInterval) -
locate
-
locate
-
lines
-
lines
-
asUncheckedRunnable
-
isYaml
-
loadProperties
- Throws:
IOException
-
loadProperties
- Throws:
IOException
-
loadProperties
- Throws:
IOException
-
getResourcePath
- Throws:
IOException
-
getResourcePath
- Throws:
IOException
-
getResourceAsStream
-
getResourceAsStream
-
readAsString
- Throws:
IOException
-
readAsString
- Throws:
IOException
-
deleteRecursive
- Throws:
IOException
-
isURL
-