Class Install

java.lang.Object
de.intarsys.tools.installresource.Install
Direct Known Subclasses:
InstallFile, InstallFileList, InstallZip

public abstract class Install extends Object
Abstract superclass for implementing the resource installation behavior.
  • Field Details

    • name

      protected final String name
    • path

      protected final String path
    • files

      protected File[] files
    • classLoader

      protected ClassLoader classLoader
  • Constructor Details

    • Install

      public Install(String path, String name, boolean platformDependent)
  • Method Details

    • copy

      protected static void copy(URL url, File file) throws IOException, FileNotFoundException
      Throws:
      IOException
      FileNotFoundException
    • createPlatformFallbackId

      protected static String createPlatformFallbackId()
    • createPlatformId

      protected static String createPlatformId()
    • deleteOnExit

      protected static void deleteOnExit(File file)
      Make file and all descendents subject to delete.
      Parameters:
      file -
    • getPlatformDefaultId

      public static String getPlatformDefaultId()
    • getPlatformFallbackId

      public static String getPlatformFallbackId()
    • getPlatformId

      public static String getPlatformId()
    • setPlatformFallbackId

      public static void setPlatformFallbackId(String value)
    • setPlatformId

      public static void setPlatformId(String value)
    • delete

      public boolean delete()
      Delete the temporary installation.
      Returns:
      true if all artifacts are deleted.
    • find

      protected Enumeration<URL> find(String name)
      Find all URL's to a specific resource.
      Parameters:
      name -
      Returns:
    • getClassLoader

      public ClassLoader getClassLoader()
    • getFile

      public File getFile()
    • getFiles

      public File[] getFiles()
    • getName

      public String getName()
    • getPath

      public String getPath()
    • getResourceNameDefault

      protected String getResourceNameDefault(String name)
    • getResourceNameFallback

      protected String getResourceNameFallback(String name)
    • getResourceNameFull

      protected String getResourceNameFull(String name)
    • getResourceNamePlain

      protected String getResourceNamePlain(String name)
    • isPlatformDependent

      public boolean isPlatformDependent()
    • load

      public File load() throws IOException
      Load the first occurrence of the designated target from the classloader.
      Returns:
      Load the first occurrence of the designated target from the classloader.
      Throws:
      IOException
    • loadAll

      public File[] loadAll() throws IOException
      Load all occurrences of the designated target from the classloader.
      Returns:
      Load all occurrences of the designated target from the classloader.
      Throws:
      IOException
    • loadURL

      protected abstract File loadURL(URL url) throws IOException
      Throws:
      IOException
    • open

      protected Enumeration<URL> open(String name) throws IOException
      Throws:
      IOException
    • prefix

      protected String prefix(String name)
    • setClassLoader

      public void setClassLoader(ClassLoader classLoader)