Package apoc.util
Class FileUtils
java.lang.Object
apoc.util.FileUtils
- Since:
- 22.05.16
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringstatic URLStreamHandlercreateURLStreamHandler(SupportedProtocols protocol) static SupportedProtocolsstatic SupportedProtocolsstatic StringgetFileUrl(String fileName) static CountingInputStreamgetInputStreamFromBinary(byte[] urlOrBinary, String compressionAlgo) static Filestatic OutputStreamgetOutputStream(SupportedProtocols protocol, String fileName, ExportConfig config) static OutputStreamgetOutputStream(String fileName) static OutputStreamgetOutputStream(String fileName, ExportConfig config) static StreamConnectiongetStreamConnection(SupportedProtocols protocol, String urlAddress, Map<String, Object> headers, String payload) static CountingInputStreamstatic booleanstatic booleanstatic SupportedProtocolsstatic StreamConnectionopenHdfsInputStream(String urlAddress) static StreamConnectionopenS3InputStream(String urlAddress) static CountingReaderstatic CountingReader
-
Field Details
-
ERROR_READ_FROM_FS_NOT_ALLOWED
- See Also:
-
ACCESS_OUTSIDE_DIR_ERROR
- See Also:
-
-
Constructor Details
-
FileUtils
public FileUtils()
-
-
Method Details
-
getFileUrl
- Throws:
MalformedURLException
-
getStreamConnection
public static StreamConnection getStreamConnection(SupportedProtocols protocol, String urlAddress, Map<String, Object> headers, String payload) throws IOException- Throws:
IOException
-
createURLStreamHandler
-
of
-
from
-
from
-
readerFor
- Throws:
IOException
-
readerFor
public static CountingReader readerFor(Object input, Map<String, Object> headers, String payload, String compressionAlgo) throws IOException- Throws:
IOException
-
inputStreamFor
public static CountingInputStream inputStreamFor(Object input, Map<String, Object> headers, String payload, String compressionAlgo) throws IOException- Throws:
IOException
-
changeFileUrlIfImportDirectoryConstrained
- Throws:
IOException
-
isFile
-
getOutputStream
-
getOutputStream
-
getOutputStream
public static OutputStream getOutputStream(SupportedProtocols protocol, String fileName, ExportConfig config) -
isImportUsingNeo4jConfig
public static boolean isImportUsingNeo4jConfig() -
openS3InputStream
- Throws:
IOException
-
openHdfsInputStream
- Throws:
IOException
-
getLogDirectory
- Returns:
- a File pointing to Neo4j's log directory, if it exists and is readable, null otherwise.
-
getInputStreamFromBinary
public static CountingInputStream getInputStreamFromBinary(byte[] urlOrBinary, String compressionAlgo)
-