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 StringchangeFileUrlIfImportDirectoryConstrained(String url, org.neo4j.graphdb.security.URLAccessChecker urlAccessChecker) static URLStreamHandlercreateURLStreamHandler(SupportedProtocols protocol) static SupportedProtocolsstatic SupportedProtocolsstatic StringgetFileUrl(String fileName) static CountingInputStreamgetInputStreamFromBinary(byte[] urlOrBinary, String compressionAlgo) static StringgetLoadFileUrl(String fileName, org.neo4j.graphdb.security.URLAccessChecker urlAccessChecker) 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, org.neo4j.graphdb.security.URLAccessChecker urlAccessChecker) static CountingInputStreaminputStreamFor(Object input, Map<String, Object> headers, String payload, String compressionAlgo, org.neo4j.graphdb.security.URLAccessChecker urlAccessChecker) static booleanstatic booleanstatic SupportedProtocolsstatic StreamConnectionopenHdfsInputStream(String urlAddress) static StreamConnectionopenS3InputStream(String urlAddress) static CountingReaderreaderFor(Object input, String compressionAlgo, org.neo4j.graphdb.security.URLAccessChecker urlAccessChecker) static CountingReaderreaderFor(Object input, Map<String, Object> headers, String payload, String compressionAlgo, org.neo4j.graphdb.security.URLAccessChecker urlAccessChecker)
-
Field Details
-
ERROR_READ_FROM_FS_NOT_ALLOWED
- See Also:
-
ACCESS_OUTSIDE_DIR_ERROR
- See Also:
-
-
Constructor Details
-
FileUtils
public FileUtils()
-
-
Method Details
-
getLoadFileUrl
public static String getLoadFileUrl(String fileName, org.neo4j.graphdb.security.URLAccessChecker urlAccessChecker) throws MalformedURLException, org.neo4j.graphdb.security.URLAccessValidationError - Throws:
MalformedURLExceptionorg.neo4j.graphdb.security.URLAccessValidationError
-
getFileUrl
- Throws:
MalformedURLException
-
getStreamConnection
public static StreamConnection getStreamConnection(SupportedProtocols protocol, String urlAddress, Map<String, Object> headers, String payload, org.neo4j.graphdb.security.URLAccessChecker urlAccessChecker) throws IOException, org.neo4j.graphdb.security.URLAccessValidationError, URISyntaxException- Throws:
IOExceptionorg.neo4j.graphdb.security.URLAccessValidationErrorURISyntaxException
-
createURLStreamHandler
-
of
-
from
-
from
-
readerFor
public static CountingReader readerFor(Object input, String compressionAlgo, org.neo4j.graphdb.security.URLAccessChecker urlAccessChecker) throws IOException, URISyntaxException, org.neo4j.graphdb.security.URLAccessValidationError - Throws:
IOExceptionURISyntaxExceptionorg.neo4j.graphdb.security.URLAccessValidationError
-
readerFor
public static CountingReader readerFor(Object input, Map<String, Object> headers, String payload, String compressionAlgo, org.neo4j.graphdb.security.URLAccessChecker urlAccessChecker) throws IOException, URISyntaxException, org.neo4j.graphdb.security.URLAccessValidationError- Throws:
IOExceptionURISyntaxExceptionorg.neo4j.graphdb.security.URLAccessValidationError
-
inputStreamFor
public static CountingInputStream inputStreamFor(Object input, Map<String, Object> headers, String payload, String compressionAlgo, org.neo4j.graphdb.security.URLAccessChecker urlAccessChecker) throws IOException, URISyntaxException, org.neo4j.graphdb.security.URLAccessValidationError- Throws:
IOExceptionURISyntaxExceptionorg.neo4j.graphdb.security.URLAccessValidationError
-
changeFileUrlIfImportDirectoryConstrained
public static String changeFileUrlIfImportDirectoryConstrained(String url, org.neo4j.graphdb.security.URLAccessChecker urlAccessChecker) throws IOException, org.neo4j.graphdb.security.URLAccessValidationError - Throws:
IOExceptionorg.neo4j.graphdb.security.URLAccessValidationError
-
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)
-