APIdia Launch Partner
Top Inners Constructors Methods
jdk.jpackage.internal.util

public final Class FileUtils

extends Object
Class Inheritance
Imports
java.io.IOException, java.nio.file.CopyOption, .FileVisitResult, .Files, .NotLinkException, .Path, .SimpleFileVisitor, .StandardCopyOption, java.nio.file.attribute.BasicFileAttributes, java.util.ArrayList, .List, .Optional, jdk.internal.util.OperatingSystem, jdk.jpackage.internal.util.function.ThrowingConsumer

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static record
private static class

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
copyRecursive(Path src, Path dest, CopyOption... options)

public static void
deleteRecursive(Path directory)

public static Path
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

FileUtilsback to summary
public FileUtils()

Method Detail

copyRecursiveback to summary
public static void copyRecursive(Path src, Path dest, CopyOption... options) throws IOException
deleteRecursiveback to summary
public static void deleteRecursive(Path directory) throws IOException
readSymlinkTargetRecursiveback to summary
public static Path readSymlinkTargetRecursive(Path symlink) throws IOException, NotLinkException
jdk.jpackage.internal.util back to summary

private final Record FileUtils.CopyAction

extends Record
Class Inheritance
Record Components
src:Path 
dest:Path 

Field Summary

Modifier and TypeField and Description
private final Path
dest

Record Component accessed by dest().

private final Path
src

Record Component accessed by src().

Constructor Summary

AccessConstructor and Description
private
CopyAction(Path src, Path dest)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
apply(CopyOption... options)

public Path
dest()

Record Component getter of dest.

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public Path
src()

Record Component getter of src.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

destback to summary
private final Path dest

Record Component accessed by dest().

srcback to summary
private final Path src

Record Component accessed by src().

Constructor Detail

CopyActionback to summary
private CopyAction(Path src, Path dest)

Method Detail

applyback to summary
pack-priv void apply(CopyOption... options) throws IOException
destback to summary
public Path dest()

Record Component getter of dest.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

srcback to summary
public Path src()

Record Component getter of src.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

jdk.jpackage.internal.util back to summary

private Class FileUtils.RecursiveDeleter

extends SimpleFileVisitor<Path>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private IOException

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static void
public FileVisitResult
postVisitDirectory(Path dir, IOException e)

Overrides java.nio.file.SimpleFileVisitor.postVisitDirectory.

Implements java.nio.file.FileVisitor.postVisitDirectory.

Invoked for a directory after entries in the directory, and all of their descendants, have been visited.

public FileVisitResult
preVisitDirectory(Path dir, BasicFileAttributes attr)

Overrides java.nio.file.SimpleFileVisitor.preVisitDirectory.

Implements java.nio.file.FileVisitor.preVisitDirectory.

Invoked for a directory before entries in the directory are visited.

private void
public FileVisitResult
visitFile(Path file, BasicFileAttributes attr)

Overrides java.nio.file.SimpleFileVisitor.visitFile.

Implements java.nio.file.FileVisitor.visitFile.

Invoked for a file in a directory.

Inherited from java.nio.file.SimpleFileVisitor:
visitFileFailed

Field Detail

exback to summary
private IOException ex

Constructor Detail

RecursiveDeleterback to summary
private RecursiveDeleter()

Method Detail

adjustAttributesback to summary
private static void adjustAttributes(Path path) throws IOException
postVisitDirectoryback to summary
public FileVisitResult postVisitDirectory(Path dir, IOException e) throws IOException

Overrides java.nio.file.SimpleFileVisitor.postVisitDirectory.

Implements java.nio.file.FileVisitor.postVisitDirectory.

Doc from java.nio.file.SimpleFileVisitor.postVisitDirectory.

Invoked for a directory after entries in the directory, and all of their descendants, have been visited.

Unless overridden, this method returns CONTINUE if the directory iteration completes without an I/O exception; otherwise this method re-throws the I/O exception that caused the iteration of the directory to terminate prematurely.

Annotations
@Override
Exceptions
IOException:

Doc from java.nio.file.FileVisitor.postVisitDirectory.

if an I/O error occurs

preVisitDirectoryback to summary
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attr) throws IOException

Overrides java.nio.file.SimpleFileVisitor.preVisitDirectory.

Implements java.nio.file.FileVisitor.preVisitDirectory.

Doc from java.nio.file.SimpleFileVisitor.preVisitDirectory.

Invoked for a directory before entries in the directory are visited.

Unless overridden, this method returns CONTINUE.

Annotations
@Override
Exceptions
IOException:

Doc from java.nio.file.FileVisitor.preVisitDirectory.

if an I/O error occurs

runActionOnPathback to summary
private void runActionOnPath(ThrowingConsumer<Path, IOException> action, Path path)
visitFileback to summary
public FileVisitResult visitFile(Path file, BasicFileAttributes attr) throws IOException

Overrides java.nio.file.SimpleFileVisitor.visitFile.

Implements java.nio.file.FileVisitor.visitFile.

Doc from java.nio.file.SimpleFileVisitor.visitFile.

Invoked for a file in a directory.

Unless overridden, this method returns CONTINUE.

Annotations
@Override
Exceptions
IOException:

Doc from java.nio.file.FileVisitor.visitFile.

if an I/O error occurs