org.gcube.portlets.user.homelibrary.util.zip
Class WorkspaceToZipModelConverter

java.lang.Object
  extended by org.gcube.portlets.user.homelibrary.util.zip.WorkspaceToZipModelConverter

public class WorkspaceToZipModelConverter
extends Object

Author:
Federico De Faveri defaveri@isti.cnr.it

Field Summary
protected  com.thoughtworks.xstream.XStream xstream
           
 
Constructor Summary
WorkspaceToZipModelConverter()
           
 
Method Summary
 ZipItem convert(WorkspaceItem workspaceItem)
           
protected  ZipItem convertAquaMapsItem(String cleanedItemName, AquaMapsItem aquaMapsItem)
           
protected  ZipItem convertDocument(String cleanedItemName, Document document)
           
protected  ZipFile convertDocumentFile(Document document)
           
protected  ZipFile convertDocumentMetadata(ZipFolder parent, String metadataName, DocumentMetadata documentMetadata)
           
protected  ZipFolder convertFolder(WorkspaceFolder workspaceFolder)
           
protected  ZipItem convertFolderItem(FolderItem folderItem)
           
protected  ZipFile convertImage(ZipFolder parent, Image image)
           
protected  ZipItem convertTimeSeries(String cleanedItemName, TimeSeries timeSeries)
           
protected static String getUniqueName(List<String> usedNames, String name)
          Calculates an unique name for the passed name and list of already used names
protected  com.thoughtworks.xstream.XStream getXStream()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xstream

protected com.thoughtworks.xstream.XStream xstream
Constructor Detail

WorkspaceToZipModelConverter

public WorkspaceToZipModelConverter()
Method Detail

getXStream

protected com.thoughtworks.xstream.XStream getXStream()

convert

public ZipItem convert(WorkspaceItem workspaceItem)
                throws InternalErrorException
Throws:
InternalErrorException

convertFolder

protected ZipFolder convertFolder(WorkspaceFolder workspaceFolder)
                           throws InternalErrorException
Throws:
InternalErrorException

convertFolderItem

protected ZipItem convertFolderItem(FolderItem folderItem)
                             throws InternalErrorException
Throws:
InternalErrorException

convertTimeSeries

protected ZipItem convertTimeSeries(String cleanedItemName,
                                    TimeSeries timeSeries)
                             throws InternalErrorException
Throws:
InternalErrorException

convertAquaMapsItem

protected ZipItem convertAquaMapsItem(String cleanedItemName,
                                      AquaMapsItem aquaMapsItem)
                               throws InternalErrorException
Throws:
InternalErrorException

convertImage

protected ZipFile convertImage(ZipFolder parent,
                               Image image)
                        throws InternalErrorException
Throws:
InternalErrorException

convertDocument

protected ZipItem convertDocument(String cleanedItemName,
                                  Document document)
                           throws InternalErrorException
Throws:
InternalErrorException

convertDocumentFile

protected ZipFile convertDocumentFile(Document document)
                               throws InternalErrorException
Throws:
InternalErrorException

convertDocumentMetadata

protected ZipFile convertDocumentMetadata(ZipFolder parent,
                                          String metadataName,
                                          DocumentMetadata documentMetadata)
                                   throws InternalErrorException
Throws:
InternalErrorException

getUniqueName

protected static String getUniqueName(List<String> usedNames,
                                      String name)
Calculates an unique name for the passed name and list of already used names

Parameters:
usedNames - the already used names.
name - the candidate name,
Returns:
the unique name.


Copyright © 2013. All Rights Reserved.