org.gcube.common.mycontainer
Class Gar

java.lang.Object
  extended by org.gcube.common.mycontainer.Gar

public class Gar
extends Object

A set of configuration and binary resources for deployment in an instance of MyContainer.

Author:
Fabio Simeoni

Constructor Summary
Gar(File file)
          Creates an instance from an existing Gar file.
Gar(String id)
          Creates an instance with a given identifier.
 
Method Summary
 Gar addConfiguration(String resourcePath)
          Adds a configuration resource to the Gar.
 Gar addConfigurations(String resourcePath)
          Adds all the configuration files in a given directory to the Gar.
 Gar addInterface(String resourcePath)
          Adds an interface resource to the Gar.
 Gar addInterfaces(String resourcePath)
          Adds all the interfaces in a given directory to the Gar.
 Gar addLibraries(String resourcePath)
          Adds all the library resources in a given directory to the Gar.
 Gar addLibrary(String resourcePath)
          Adds a library resource to the Gar.
 List<File> configuration()
           
 File file()
           
 String id()
           
 List<File> interfaces()
          Returns the interface resources in this Gar.
 long lastModified()
          Return the most recent modification to the resources in the Gar.
 List<File> libs()
          Returns the library resources in this Gar.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Gar

public Gar(File file)
Creates an instance from an existing Gar file.


Gar

public Gar(String id)
Creates an instance with a given identifier.

Parameters:
id -
Method Detail

lastModified

public long lastModified()
Return the most recent modification to the resources in the Gar.

Returns:
the lastModified

addLibrary

public Gar addLibrary(String resourcePath)
               throws IllegalArgumentException
Adds a library resource to the Gar.

Parameters:
resourcePath - the path to the resource.
Returns:
this Gar
Throws:
IllegalArgumentException - if the resource does not exist or is not readable.

addLibraries

public Gar addLibraries(String resourcePath)
                 throws IllegalArgumentException
Adds all the library resources in a given directory to the Gar.

Parameters:
resourcePath - the path to the directory
Returns:
this Gar
Throws:
IllegalArgumentException - if the directory does not exist or is not readable or writable, or if the files in it are not readable;

addInterface

public Gar addInterface(String resourcePath)
                 throws IllegalArgumentException
Adds an interface resource to the Gar.

Parameters:
resourcePath - the path to the resource.
Returns:
this Gar
Throws:
IllegalArgumentException - if the resource does not exist or is not readable.

addInterfaces

public Gar addInterfaces(String resourcePath)
                  throws IllegalArgumentException
Adds all the interfaces in a given directory to the Gar.

Parameters:
resourcePath - the path to the directory
Returns:
this Gar
Throws:
IllegalArgumentException - if the directory does not exist or is not readable or writable, or if the files in it are not readable;

addConfiguration

public Gar addConfiguration(String resourcePath)
                     throws IllegalArgumentException
Adds a configuration resource to the Gar.

Parameters:
resourcePath - the path to the resource.
Returns:
this Gar
Throws:
IllegalArgumentException - if the resource does not exist or is not readable.

addConfigurations

public Gar addConfigurations(String resourcePath)
                      throws IllegalArgumentException
Adds all the configuration files in a given directory to the Gar.

Parameters:
resourcePath - the path to the directory
Returns:
this Gar
Throws:
IllegalArgumentException - if the directory does not exist or is not readable or writable, or if the files in it are not readable;

id

public String id()
Returns:
the name

libs

public List<File> libs()
Returns the library resources in this Gar.

Returns:
the libraries

interfaces

public List<File> interfaces()
Returns the interface resources in this Gar.

Returns:
the interfaces

configuration

public List<File> configuration()
Returns:
the configDir

file

public File file()
Returns:
the file


Copyright © 2013. All Rights Reserved.