Package nbbrd.io

Class Resource


  • public class Resource
    extends Object
    Author:
    Philippe Charles
    • Constructor Detail

      • Resource

        public Resource()
    • Method Detail

      • getFile

        public @NonNull Optional<File> getFile​(@NonNull Path path)
        Returns a File object representing this path. Where this Path is associated with the default provider, then this method is equivalent to returning a File object constructed with the String representation of this path.

        If this path was created by invoking the File toPath method then there is no guarantee that the File object returned by this method is equal to the original File.

        Parameters:
        path -
        Returns:
        an optional File object representing this path if associated with the default provider
      • ensureClosed

        public void ensureClosed​(@NonNull Throwable exception,
                                 @Nullable Closeable closeable)