com.ibm.ram.client
Class LocalArchiveFolderArtifact

java.lang.Object
  extended by com.ibm.ram.common.data.Artifact
      extended by com.ibm.ram.common.data.FolderArtifact
          extended by com.ibm.ram.client.RAMFolderArtifact
              extended by com.ibm.ram.client.LocalFolderArtifact
                  extended by com.ibm.ram.client.LocalArchiveFolderArtifact

public class LocalArchiveFolderArtifact
extends LocalFolderArtifact

Enables the use of a local archive file as a folder in your asset. Note: This artifact will be treated as read only. You cannot add artifacts to it. You must extract the archive to a local folder and make that folder the root.

Since:
7.1
Author:
kbauer

Field Summary
 
Fields inherited from class com.ibm.ram.client.LocalFolderArtifact
fLocalFolder
 
Fields inherited from class com.ibm.ram.common.data.Artifact
FILE_DELIM, TYPE_FILE, TYPE_FOLDER, TYPE_URL
 
Constructor Summary
LocalArchiveFolderArtifact(java.io.File file)
          Create RAM Folder artifact for an asset where all the children will be the expanded contents of an archive file (zip, jar, war, ear, ras, etc) Add this artifact to an asset or set it as the root
LocalArchiveFolderArtifact(RAMAsset targetAsset, Asset sourceAsset, IProgressMonitor monitor)
          Given a source asset create a zipped archive as the root of the target asset
 
Method Summary
 void addArtifact(Artifact artifact)
          Add an new artifact as a child of this folder artifact.
 void addArtifact(java.lang.String relativePath, Artifact artifactimpl)
          Add an artifact relative to this folder artifact.
 Artifact[] computeArtifactsAsFlatList(IProgressMonitor monitor)
          Normalize the list of children artifacts as a flat list.
 java.io.File getArchiveFile()
           
 Artifact getChild(java.lang.String path)
          Returns a child artifact from a given path or null if it does not exist
 Artifact[] getChildren()
          Returns all the children artifacts
 java.io.File getFolder()
          Return the underlying File object
 boolean hasChildren()
          Returns true if the folder has children
 boolean removeArtifact(Artifact artifact)
          Remove a child artifact.
 boolean removeArtifact(java.lang.String relativePath)
          Remove an artifact relative to this folder artifact paths should have no leading or trailing slashes
 void setChildren(Artifact[] children)
           
 
Methods inherited from class com.ibm.ram.client.RAMFolderArtifact
getArtifactFullPath, getAsset, getCreationDate, getLabel, getName, getPath, getReference, getSize, setAsset, setCreationDate, setLabel, setName, setPath, setReference, setSize, setType
 
Methods inherited from class com.ibm.ram.common.data.FolderArtifact
getType
 
Methods inherited from class com.ibm.ram.common.data.Artifact
getChecksum, getMimeType, setChecksum, setMimeType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocalArchiveFolderArtifact

public LocalArchiveFolderArtifact(java.io.File file)
Create RAM Folder artifact for an asset where all the children will be the expanded contents of an archive file (zip, jar, war, ear, ras, etc) Add this artifact to an asset or set it as the root

Parameters:
file - the archive
Since:
7.1

LocalArchiveFolderArtifact

public LocalArchiveFolderArtifact(RAMAsset targetAsset,
                                  Asset sourceAsset,
                                  IProgressMonitor monitor)
                           throws RAMRuntimeException,
                                  java.io.IOException
Given a source asset create a zipped archive as the root of the target asset

Parameters:
asset -
Throws:
RAMRuntimeException
java.io.IOException
Since:
7.1
Method Detail

getArchiveFile

public java.io.File getArchiveFile()
Returns:
the archiveFile
Since:
7.1

getFolder

public java.io.File getFolder()
Description copied from class: LocalFolderArtifact
Return the underlying File object

Overrides:
getFolder in class LocalFolderArtifact

addArtifact

public void addArtifact(Artifact artifact)
                 throws RAMRuntimeException
Description copied from class: RAMFolderArtifact
Add an new artifact as a child of this folder artifact.

Overrides:
addArtifact in class RAMFolderArtifact
Throws:
RAMRuntimeException

addArtifact

public void addArtifact(java.lang.String relativePath,
                        Artifact artifactimpl)
Description copied from class: RAMFolderArtifact
Add an artifact relative to this folder artifact. Paths should have no leading or trailing slashes.

Overrides:
addArtifact in class RAMFolderArtifact

computeArtifactsAsFlatList

public Artifact[] computeArtifactsAsFlatList(IProgressMonitor monitor)
Description copied from class: RAMFolderArtifact
Normalize the list of children artifacts as a flat list.

Overrides:
computeArtifactsAsFlatList in class RAMFolderArtifact
Returns:

getChildren

public Artifact[] getChildren()
Description copied from class: LocalFolderArtifact
Returns all the children artifacts

Overrides:
getChildren in class LocalFolderArtifact
Returns:
The list of child artifacts.

hasChildren

public boolean hasChildren()
Description copied from class: LocalFolderArtifact
Returns true if the folder has children

Overrides:
hasChildren in class LocalFolderArtifact
Returns:
true is the FolderArtifact has child artifacts.

getChild

public Artifact getChild(java.lang.String path)
Description copied from class: RAMFolderArtifact
Returns a child artifact from a given path or null if it does not exist

Overrides:
getChild in class RAMFolderArtifact
Parameters:
path - use / for a delimiter. Do not include a leading or trailing slash.

removeArtifact

public boolean removeArtifact(Artifact artifact)
Description copied from class: RAMFolderArtifact
Remove a child artifact.

Overrides:
removeArtifact in class RAMFolderArtifact

removeArtifact

public boolean removeArtifact(java.lang.String relativePath)
Description copied from class: RAMFolderArtifact
Remove an artifact relative to this folder artifact paths should have no leading or trailing slashes

Overrides:
removeArtifact in class RAMFolderArtifact
Returns:
true is artifact was found and removed

setChildren

public void setChildren(Artifact[] children)
Overrides:
setChildren in class RAMFolderArtifact
Parameters:
children - The list of child artifacts.