public class CoreIOUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
CoreIOUtils.CachedURL |
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_BUFFER_SIZE |
static String |
MIME_TYPE_SHA1 |
static String |
newLineString |
| Constructor and Description |
|---|
CoreIOUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
Arrays_equals(byte[] a,
int aFromIndex,
int aToIndex,
byte[] b,
int bFromIndex,
int bToIndex) |
static Set<CopyOption> |
asCopyOptions(Set<net.thevpc.nuts.NutsPathOption> noptions) |
static String |
betterPath(String path1) |
static BufferedReader |
bufferedReaderOf(byte[] bytes) |
static String |
buildUrl(String url,
String path) |
static char[] |
bytesToChars(byte[] bytes) |
static byte[] |
charsToBytes(char[] chars) |
static boolean |
compareContent(Path file1,
Path file2,
net.thevpc.nuts.NutsSession session) |
static OutputStream |
convertOutputStream(OutputStream out,
net.thevpc.nuts.NutsTerminalMode expected,
net.thevpc.nuts.spi.NutsSystemTerminalBase term,
net.thevpc.nuts.NutsSession session)
Deprecated.
|
static ExtendedFormatAware |
convertOutputStreamToExtendedFormatAware(OutputStream out,
net.thevpc.nuts.NutsTerminalMode expected,
net.thevpc.nuts.spi.NutsSystemTerminalBase term,
net.thevpc.nuts.NutsSession session)
Deprecated.
|
static long |
copy(InputStream from,
OutputStream to,
boolean closeInput,
boolean closeOutput,
net.thevpc.nuts.NutsSession session) |
static long |
copy(InputStream in,
OutputStream out,
int bufferSize,
net.thevpc.nuts.NutsSession session)
copy input stream to output stream using the buffer size in bytes
|
static long |
copy(InputStream in,
OutputStream out,
net.thevpc.nuts.NutsSession session)
copy input to output
|
static void |
copy(Reader in,
Writer out,
int bufferSize,
net.thevpc.nuts.NutsSession session)
copy input stream to output stream using the buffer size in bytes
|
static void |
copy(Reader in,
Writer out,
net.thevpc.nuts.NutsSession session)
copy input to output
|
static void |
copyFolder(Path src,
Path dest,
net.thevpc.nuts.NutsSession session) |
static InputStream |
createBytesStream(byte[] bytes,
net.thevpc.nuts.NutsMessage message,
String contentType,
String kind,
net.thevpc.nuts.NutsSession session) |
static void |
delete(net.thevpc.nuts.NutsSession session,
File file) |
static void |
delete(net.thevpc.nuts.NutsSession session,
Path file) |
static String |
escapePropsString(String theString,
boolean escapeSpace) |
static String |
getAbsolutePath(String path) |
static InputStream |
getCachedUrlWithSHA1(String path,
String sourceTypeName,
boolean ignoreSha1NotFound,
net.thevpc.nuts.NutsSession session) |
static String |
getFileExtension(String s) |
static String |
getFileExtension(String s,
boolean longest,
boolean includeDot) |
static net.thevpc.nuts.spi.NutsTransportConnection |
getHttpClientFacade(net.thevpc.nuts.NutsSession session,
String url) |
static String |
getNewLine() |
static boolean |
isAbsolutePath(String location) |
static boolean |
isObsoleteInstant(net.thevpc.nuts.NutsSession session,
Instant instant) |
static boolean |
isObsoletePath(net.thevpc.nuts.NutsSession session,
net.thevpc.nuts.NutsPath path) |
static boolean |
isObsoletePath(net.thevpc.nuts.NutsSession session,
Path path) |
static boolean |
isURL(String url) |
static byte[] |
loadByteArray(InputStream r,
boolean close,
net.thevpc.nuts.NutsSession session) |
static byte[] |
loadByteArray(InputStream stream,
int maxSize,
boolean close,
net.thevpc.nuts.NutsSession session) |
static byte[] |
loadByteArray(InputStream r,
net.thevpc.nuts.NutsSession session) |
static char[] |
loadCharArray(Reader r,
net.thevpc.nuts.NutsSession session) |
static byte[] |
loadFileContentLenient(Path out) |
static String |
loadString(InputStream is,
boolean close,
net.thevpc.nuts.NutsSession session) |
static String |
loadString(Reader is,
boolean close,
net.thevpc.nuts.NutsSession session) |
static String |
longestCommonParent(String path1,
String path2) |
static int |
readBestEffort(byte[] b,
int off,
int len,
InputStream in,
net.thevpc.nuts.NutsSession session) |
static byte[] |
readBestEffort(int len,
InputStream in,
net.thevpc.nuts.NutsSession session) |
static String |
replaceFilePrefix(String path,
String prefix,
String replacement) |
static String |
replaceFilePrefixes(String path,
Map<String,String> map) |
static File |
resolveLocalFileFromResource(Class cls,
String url,
net.thevpc.nuts.NutsSession session) |
static File |
resolveLocalFileFromURL(URL url) |
static Path |
resolveLocalPathFromURL(URL url) |
static net.thevpc.nuts.NutsPrintStream |
resolveOut(net.thevpc.nuts.NutsSession session) |
static String |
resolveRepositoryPath(net.thevpc.nuts.NutsAddRepositoryOptions options,
Path rootFolder,
net.thevpc.nuts.NutsSession session) |
static URL |
resolveURLFromResource(Class cls,
String urlPath,
net.thevpc.nuts.NutsSession session) |
static net.thevpc.nuts.NutsStream<String> |
safeLines(byte[] bytes,
net.thevpc.nuts.NutsSession session) |
static void |
storeProperties(Map<String,String> props,
OutputStream out,
boolean sort,
net.thevpc.nuts.NutsSession session) |
static void |
storeProperties(Map<String,String> props,
Writer w,
boolean sort,
net.thevpc.nuts.NutsSession session) |
static InputStream |
toInterruptible(InputStream in) |
static Path |
toPathInputSource(NutsStreamOrPath is,
List<Path> tempPaths,
net.thevpc.nuts.NutsSession session) |
static PrintWriter |
toPrintWriter(OutputStream writer,
net.thevpc.nuts.spi.NutsSystemTerminalBase term,
net.thevpc.nuts.NutsSession session)
Deprecated.
|
static PrintWriter |
toPrintWriter(Writer writer,
net.thevpc.nuts.spi.NutsSystemTerminalBase term,
net.thevpc.nuts.NutsSession session)
Deprecated.
|
static PathInfo.Status |
tryWrite(byte[] content,
net.thevpc.nuts.NutsPath out,
DoWhenExist doWhenExist,
DoWhenNotExists doWhenNotExist,
net.thevpc.nuts.NutsSession session) |
static PathInfo.Status |
tryWrite(byte[] content,
net.thevpc.nuts.NutsPath out,
net.thevpc.nuts.NutsSession session) |
static PathInfo.Status |
tryWriteStatus(byte[] content,
net.thevpc.nuts.NutsPath out,
net.thevpc.nuts.NutsSession session) |
static String |
urlEncodeString(String s,
net.thevpc.nuts.NutsSession session) |
public static final int DEFAULT_BUFFER_SIZE
public static final String MIME_TYPE_SHA1
public static String newLineString
@Deprecated public static PrintWriter toPrintWriter(Writer writer, net.thevpc.nuts.spi.NutsSystemTerminalBase term, net.thevpc.nuts.NutsSession session)
@Deprecated public static PrintWriter toPrintWriter(OutputStream writer, net.thevpc.nuts.spi.NutsSystemTerminalBase term, net.thevpc.nuts.NutsSession session)
@Deprecated public static OutputStream convertOutputStream(OutputStream out, net.thevpc.nuts.NutsTerminalMode expected, net.thevpc.nuts.spi.NutsSystemTerminalBase term, net.thevpc.nuts.NutsSession session)
@Deprecated public static ExtendedFormatAware convertOutputStreamToExtendedFormatAware(OutputStream out, net.thevpc.nuts.NutsTerminalMode expected, net.thevpc.nuts.spi.NutsSystemTerminalBase term, net.thevpc.nuts.NutsSession session)
public static String resolveRepositoryPath(net.thevpc.nuts.NutsAddRepositoryOptions options, Path rootFolder, net.thevpc.nuts.NutsSession session)
public static net.thevpc.nuts.NutsPrintStream resolveOut(net.thevpc.nuts.NutsSession session)
public static void copy(Reader in, Writer out, net.thevpc.nuts.NutsSession session)
in - entreeout - sortiepublic static long copy(InputStream in, OutputStream out, net.thevpc.nuts.NutsSession session)
in - entreeout - sortiepublic static long copy(InputStream in, OutputStream out, int bufferSize, net.thevpc.nuts.NutsSession session)
in - entreeout - sortiebufferSize - bufferSizepublic static void copy(Reader in, Writer out, int bufferSize, net.thevpc.nuts.NutsSession session)
in - entreeout - sortiebufferSize - bufferSizepublic static String loadString(InputStream is, boolean close, net.thevpc.nuts.NutsSession session)
public static String loadString(Reader is, boolean close, net.thevpc.nuts.NutsSession session)
public static char[] loadCharArray(Reader r, net.thevpc.nuts.NutsSession session)
public static byte[] loadByteArray(InputStream r, net.thevpc.nuts.NutsSession session)
public static byte[] loadByteArray(InputStream r, boolean close, net.thevpc.nuts.NutsSession session)
public static byte[] loadByteArray(InputStream stream, int maxSize, boolean close, net.thevpc.nuts.NutsSession session)
public static long copy(InputStream from, OutputStream to, boolean closeInput, boolean closeOutput, net.thevpc.nuts.NutsSession session)
public static void delete(net.thevpc.nuts.NutsSession session,
File file)
public static void delete(net.thevpc.nuts.NutsSession session,
Path file)
public static String getFileExtension(String s, boolean longest, boolean includeDot)
public static boolean isURL(String url)
public static net.thevpc.nuts.spi.NutsTransportConnection getHttpClientFacade(net.thevpc.nuts.NutsSession session,
String url)
public static URL resolveURLFromResource(Class cls, String urlPath, net.thevpc.nuts.NutsSession session)
public static File resolveLocalFileFromResource(Class cls, String url, net.thevpc.nuts.NutsSession session)
public static byte[] charsToBytes(char[] chars)
public static char[] bytesToChars(byte[] bytes)
public static InputStream getCachedUrlWithSHA1(String path, String sourceTypeName, boolean ignoreSha1NotFound, net.thevpc.nuts.NutsSession session)
public static void storeProperties(Map<String,String> props, OutputStream out, boolean sort, net.thevpc.nuts.NutsSession session)
public static void storeProperties(Map<String,String> props, Writer w, boolean sort, net.thevpc.nuts.NutsSession session)
public static Path toPathInputSource(NutsStreamOrPath is, List<Path> tempPaths, net.thevpc.nuts.NutsSession session)
public static String getNewLine()
public static boolean isAbsolutePath(String location)
public static InputStream toInterruptible(InputStream in)
public static boolean isObsoletePath(net.thevpc.nuts.NutsSession session,
Path path)
public static boolean isObsoletePath(net.thevpc.nuts.NutsSession session,
net.thevpc.nuts.NutsPath path)
public static boolean isObsoleteInstant(net.thevpc.nuts.NutsSession session,
Instant instant)
public static byte[] loadFileContentLenient(Path out)
public static byte[] readBestEffort(int len,
InputStream in,
net.thevpc.nuts.NutsSession session)
public static int readBestEffort(byte[] b,
int off,
int len,
InputStream in,
net.thevpc.nuts.NutsSession session)
public static boolean Arrays_equals(byte[] a,
int aFromIndex,
int aToIndex,
byte[] b,
int bFromIndex,
int bToIndex)
public static boolean compareContent(Path file1, Path file2, net.thevpc.nuts.NutsSession session)
public static InputStream createBytesStream(byte[] bytes, net.thevpc.nuts.NutsMessage message, String contentType, String kind, net.thevpc.nuts.NutsSession session)
public static String replaceFilePrefix(String path, String prefix, String replacement)
public static PathInfo.Status tryWriteStatus(byte[] content, net.thevpc.nuts.NutsPath out, net.thevpc.nuts.NutsSession session)
public static PathInfo.Status tryWrite(byte[] content, net.thevpc.nuts.NutsPath out, net.thevpc.nuts.NutsSession session)
public static PathInfo.Status tryWrite(byte[] content, net.thevpc.nuts.NutsPath out, DoWhenExist doWhenExist, DoWhenNotExists doWhenNotExist, net.thevpc.nuts.NutsSession session)
public static Set<CopyOption> asCopyOptions(Set<net.thevpc.nuts.NutsPathOption> noptions)
public static net.thevpc.nuts.NutsStream<String> safeLines(byte[] bytes, net.thevpc.nuts.NutsSession session)
public static BufferedReader bufferedReaderOf(byte[] bytes)
Copyright © 2022 vpc open source initiative. All rights reserved.