Package org.apache.spark.util
Interface SparkFileUtils
- All Superinterfaces:
org.apache.spark.internal.Logging
public interface SparkFileUtils
extends org.apache.spark.internal.Logging
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.spark.internal.Logging
org.apache.spark.internal.Logging.LogStringContext, org.apache.spark.internal.Logging.SparkShellLoggingFilter
-
Method Summary
Modifier and TypeMethodDescriptionboolean
createDirectory
(File dir) Create a directory given the abstract pathnamecreateDirectory
(String root, String namePrefix) Create a directory inside the given parent directory.Create a temporary directory inside thejava.io.tmpdir
prefixed withspark
.createTempDir
(String root, String namePrefix) Create a temporary directory inside the given parent directory.void
deleteRecursively
(File file) Delete a file or directory and its contents recursively.File[]
Lists files recursively.resolveURI
(String path) Return a well-formed URI for the file described by a user input string.Methods inherited from interface org.apache.spark.internal.Logging
initializeForcefully, initializeLogIfNecessary, initializeLogIfNecessary, initializeLogIfNecessary$default$2, isTraceEnabled, log, logDebug, logDebug, logDebug, logDebug, logError, logError, logError, logError, logInfo, logInfo, logInfo, logInfo, logName, LogStringContext, logTrace, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, logWarning, org$apache$spark$internal$Logging$$log_, org$apache$spark$internal$Logging$$log__$eq, withLogContext
-
Method Details
-
resolveURI
Return a well-formed URI for the file described by a user input string.If the supplied path does not contain a scheme, or is a relative path, it will be converted into an absolute path with a file:// scheme.
- Parameters:
path
- (undocumented)- Returns:
- (undocumented)
-
recursiveList
Lists files recursively.- Parameters:
f
- (undocumented)- Returns:
- (undocumented)
-
createDirectory
Create a directory given the abstract pathname- Parameters:
dir
- (undocumented)- Returns:
- true, if the directory is successfully created; otherwise, return false.
-
createDirectory
Create a directory inside the given parent directory. The directory is guaranteed to be newly created, and is not marked for automatic deletion.- Parameters:
root
- (undocumented)namePrefix
- (undocumented)- Returns:
- (undocumented)
-
createTempDir
File createTempDir()Create a temporary directory inside thejava.io.tmpdir
prefixed withspark
. The directory will be automatically deleted when the VM shuts down.- Returns:
- (undocumented)
-
createTempDir
Create a temporary directory inside the given parent directory. The directory will be automatically deleted when the VM shuts down.- Parameters:
root
- (undocumented)namePrefix
- (undocumented)- Returns:
- (undocumented)
-
deleteRecursively
Delete a file or directory and its contents recursively. Don't follow directories if they are symlinks. Throws an exception if deletion is unsuccessful.- Parameters:
file
- (undocumented)
-