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 SummaryNested classes/interfaces inherited from interface org.apache.spark.internal.Loggingorg.apache.spark.internal.Logging.LogStringContext, org.apache.spark.internal.Logging.SparkShellLoggingFilter
- 
Method SummaryModifier and TypeMethodDescriptionvoidcleanDirectory(File dir) Delete recursively while keeping the given directory itself.booleancontentEquals(File file1, File file2) Return true if the content of the files are equal or they both don't existvoidcopyDirectory(File src, File dir) Copy src to the target directory simply.voidvoidcopyFileToDirectory(File file, File dir) Copy file to the target directory simply.voidcopyURLToFile(URL url, File file) booleancreateDirectory(File dir) Create a directory given the abstract pathnamecreateDirectory(String root, String namePrefix) Create a directory inside the given parent directory.voidcreateParentDirs(File file) Create a temporary directory inside thejava.io.tmpdirprefixed withspark.createTempDir(String root, String namePrefix) Create a temporary directory inside the given parent directory.voiddeleteQuietly(File file) Delete a file or directory and its contents recursively without throwing exceptions.voiddeleteRecursively(File file) Delete a file or directory and its contents recursively.voidforceDeleteOnExit(File file) Registers the file or directory for deletion when the JVM exists.Lists regular files recursively.Lists regular paths recursively.voidmoveDirectory(File src, File dst) Move src to dst simply.voidMove 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.longSize of files recursively.voidMethods inherited from interface org.apache.spark.internal.LogginginitializeForcefully, 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- 
resolveURIReturn 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)
 
- 
sizeOfSize of files recursively.- Parameters:
- f- (undocumented)
- Returns:
- (undocumented)
 
- 
recursiveListLists files recursively.- Parameters:
- f- (undocumented)
- Returns:
- (undocumented)
 
- 
listFilesLists regular files recursively.- Parameters:
- f- (undocumented)
- Returns:
- (undocumented)
 
- 
listPathsLists regular paths recursively.- Parameters:
- f- (undocumented)
- Returns:
- (undocumented)
 
- 
createDirectoryCreate a directory given the abstract pathname- Parameters:
- dir- (undocumented)
- Returns:
- true, if the directory is successfully created; otherwise, return false.
 
- 
createDirectoryCreate 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)
 
- 
createTempDirFile createTempDir()Create a temporary directory inside thejava.io.tmpdirprefixed withspark. The directory will be automatically deleted when the VM shuts down.- Returns:
- (undocumented)
 
- 
createTempDirCreate 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
- 
cleanDirectoryDelete recursively while keeping the given directory itself.
- 
deleteRecursivelyDelete 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)
 
- 
deleteQuietlyDelete a file or directory and its contents recursively without throwing exceptions.
- 
forceDeleteOnExitRegisters the file or directory for deletion when the JVM exists.
- 
getFile
- 
getFile
- 
moveFileMove src to dst simply. File attribute times are not copied.
- 
moveDirectoryMove src to dst simply. File attribute times are not copied.
- 
copyDirectoryCopy src to the target directory simply. File attribute times are not copied.
- 
copyFileToDirectoryCopy file to the target directory simply. File attribute times are not copied.
- 
copyFile
- 
copyURLToFile
- 
contentEqualsReturn true if the content of the files are equal or they both don't exist
- 
touch
 
-