Class FileInitializer

java.lang.Object
org.eclipse.jetty.start.FileInitializer
Direct Known Subclasses:
BaseHomeFileInitializer, DownloadFileInitializer, LocalFileInitializer, TestFileInitializer

public abstract class FileInitializer extends Object
Interface for initializing a file resource.
  • Field Details

    • _scheme

      protected final Set<String> _scheme
    • _basehome

      protected final BaseHome _basehome
  • Constructor Details

    • FileInitializer

      protected FileInitializer(BaseHome basehome, String... scheme)
  • Method Details

    • isApplicable

      public boolean isApplicable(URI uri)
    • create

      public abstract boolean create(URI uri, String location) throws IOException
      Initialize a file resource
      Parameters:
      uri - the URI of the resource acting as its source
      location - the simple string reference to the output file, suitable for searching for the file in other locations (like ${jetty.home} or ${jetty.dir}) *
      Returns:
      true if local file system is modified.
      Throws:
      IOException - if there was an attempt to initialize, but an error occurred.
    • check

      public boolean check(URI uri, String location) throws IOException
      Throws:
      IOException
    • getDestination

      protected Path getDestination(URI uri, String location) throws IOException
      Throws:
      IOException
    • isFilePresent

      protected boolean isFilePresent(Path... paths) throws IOException
      Test if any of the Paths exist (as files)
      Parameters:
      paths - the list of paths to check
      Returns:
      true if the path exist (as a file), false if it doesn't exist
      Throws:
      IOException - if the path points to a non-file, or is not readable.
    • copyDirectory

      public boolean copyDirectory(Path source, Path destination) throws IOException
      Throws:
      IOException