Package jetbrains.buildServer.util
Class NioFileUtil
- java.lang.Object
-
- jetbrains.buildServer.util.NioFileUtil
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
deleteRecursively(Path path)
Deletes the directory recursively.static void
deleteRecursively(Path path, Set<Path> excludes)
Deletes the directory recursively.static File
getCanonicalFile(File file, LinkOption... options)
Returns the canonical form of the pathname.static Path
getCanonicalFile(Path path, LinkOption... options)
Returns the canonical form of the pathname.static void
writeViaTmpFile(File targetFile, InputStream content)
Analogue ofFileUtil.writeViaTmpFile(File, InputStream, FileUtil.IOAction)
with atomic rename from tmp file to target.
-
-
-
Method Detail
-
getCanonicalFile
@NotNull public static File getCanonicalFile(@NotNull File file, @NotNull LinkOption... options) throws IOException
Returns the canonical form of the pathname.- Parameters:
file
- the pathname to get canonical representation of.options
- options indicating how symbolic links are handled.- Returns:
- the canonical pathname denoting the same file or directory as
file
. - Throws:
IOException
- if an I/O error occurs (i. e. if the link exists and some of the filesystem queries fail).- See Also:
Path.toRealPath(LinkOption...)
,File.getCanonicalFile()
-
getCanonicalFile
@NotNull public static Path getCanonicalFile(@NotNull Path path, @NotNull LinkOption... options) throws IOException
Returns the canonical form of the pathname.- Parameters:
path
- the pathname to get canonical representation of.options
- options indicating how symbolic links are handled.- Returns:
- the canonical pathname denoting the same file or directory as
path
. - Throws:
IOException
- if an I/O error occurs (i. e. if the link exists and some of the filesystem queries fail).- See Also:
Path.toRealPath(LinkOption...)
,File.getCanonicalFile()
-
deleteRecursively
public static void deleteRecursively(@NotNull Path path) throws IOException
Deletes the directory recursively.- Parameters:
path
- the directory to delete.- Throws:
IOException
- if an I/O error occurs.
-
deleteRecursively
public static void deleteRecursively(@NotNull Path path, @NotNull Set<Path> excludes) throws IOException
Deletes the directory recursively.- Parameters:
path
- the directory to delete.excludes
- the set of basenames (denoting either files or directories) to be preserved when deleting.- Throws:
IOException
- if an I/O error occurs.
-
writeViaTmpFile
public static void writeViaTmpFile(@NotNull File targetFile, @NotNull InputStream content) throws IOException
Analogue ofFileUtil.writeViaTmpFile(File, InputStream, FileUtil.IOAction)
with atomic rename from tmp file to target.- Throws:
IOException
-
-