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 TypeMethodDescriptionvoid
cleanDirectory
(File dir) Delete recursively while keeping the given directory itself.boolean
contentEquals
(File file1, File file2) Return true if the content of the files are equal or they both don't existvoid
copyDirectory
(File src, File dir) Copy src to the target directory simply.void
void
copyFileToDirectory
(File file, File dir) Copy file to the target directory simply.void
copyURLToFile
(URL url, File file) boolean
createDirectory
(File dir) Create a directory given the abstract pathnamecreateDirectory
(String root, String namePrefix) Create a directory inside the given parent directory.void
createParentDirs
(File file) 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
deleteQuietly
(File file) Delete a file or directory and its contents recursively without throwing exceptions.void
deleteRecursively
(File file) Delete a file or directory and its contents recursively.void
forceDeleteOnExit
(File file) Registers the file or directory for deletion when the JVM exists.Lists regular files recursively.Lists regular paths recursively.void
moveDirectory
(File src, File dst) Move src to dst simply.void
Move src to dst simply.File[]
Lists files recursively.resolveURI
(String path) Return a well-formed URI for the file described by a user input string.long
Size of files recursively.void
Methods inherited from interface org.apache.spark.internal.Logging
initializeForcefully, initializeLogIfNecessary, initializeLogIfNecessary, initializeLogIfNecessary$default$2, isTraceEnabled, log, logBasedOnLevel, logDebug, logDebug, logDebug, logDebug, logError, logError, logError, logError, logInfo, logInfo, logInfo, logInfo, logName, LogStringContext, logTrace, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, logWarning, MDC, 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)
-
sizeOf
Size of files recursively.- Parameters:
f
- (undocumented)- Returns:
- (undocumented)
-
recursiveList
Lists files recursively.- Parameters:
f
- (undocumented)- Returns:
- (undocumented)
-
listFiles
Lists regular files recursively.- Parameters:
f
- (undocumented)- Returns:
- (undocumented)
-
listPaths
Lists regular paths 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)
-
createParentDirs
-
cleanDirectory
Delete recursively while keeping the given directory itself. -
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)
-
deleteQuietly
Delete a file or directory and its contents recursively without throwing exceptions. -
forceDeleteOnExit
Registers the file or directory for deletion when the JVM exists. -
getFile
-
getFile
-
moveFile
Move src to dst simply. File attribute times are not copied. -
moveDirectory
Move src to dst simply. File attribute times are not copied. -
copyDirectory
Copy src to the target directory simply. File attribute times are not copied. -
copyFileToDirectory
Copy file to the target directory simply. File attribute times are not copied. -
copyFile
-
copyURLToFile
-
contentEquals
Return true if the content of the files are equal or they both don't exist -
touch
-