org.ow2.weblab.content.binary
Class BinaryFolderContentManager

java.lang.Object
  extended by org.ow2.weblab.content.FolderContentManager
      extended by org.ow2.weblab.content.binary.BinaryFolderContentManager

public class BinaryFolderContentManager
extends FolderContentManager


Field Summary
 
Fields inherited from class org.ow2.weblab.content.FolderContentManager
bufferSize, folder, propertyFileName, propertyKey, SIMPLE_RESOURCE_RDF_HELPER
 
Constructor Summary
protected BinaryFolderContentManager(java.lang.String folderPath)
           
 
Method Summary
protected  void copyFile(java.io.File file, java.io.File newFile)
           
 org.weblab_project.core.model.content.BinaryContent getContent(java.lang.String contentUri, int offset, int limit)
          Return a Content using the contentUri, an offset and a limit
static BinaryFolderContentManager getInstance()
           
static BinaryFolderContentManager getInstance(java.lang.String folderPath)
           
 void saveContent(org.weblab_project.core.model.content.Content content)
          Save the content.
 void saveFile(java.io.File file, java.lang.String uri)
          Add new file to the content manager (copy it to the internal repository)
 
Methods inherited from class org.ow2.weblab.content.FolderContentManager
checkFolder, getFileFromResourceAndPredicate, getFileFromURI, getFileFromWLRi, getFolder, getFolderValue, getNativeFileFromResource, getNormalisedFileFromResource, setFolder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryFolderContentManager

protected BinaryFolderContentManager(java.lang.String folderPath)
                              throws org.weblab_project.core.exception.WebLabUncheckedException
Throws:
org.weblab_project.core.exception.WebLabUncheckedException
Method Detail

getContent

public org.weblab_project.core.model.content.BinaryContent getContent(java.lang.String contentUri,
                                                                      int offset,
                                                                      int limit)
                                                               throws org.weblab_project.core.exception.WebLabCheckedException
Return a Content using the contentUri, an offset and a limit

Specified by:
getContent in class FolderContentManager
Parameters:
contentUri - a valid WLRI which identify a Content in this "repository"
offset - beginning part of the file
limit - maximum size of the part
Returns:
a Content object containing with data writes
Throws:
org.weblab_project.core.exception.WebLabCheckedException - most of time an access problem

copyFile

protected void copyFile(java.io.File file,
                        java.io.File newFile)
                 throws org.weblab_project.core.exception.WebLabCheckedException
Parameters:
file - Input file
newFile - Output file
Throws:
org.weblab_project.core.exception.WebLabCheckedException - If an IOException occurs.

saveFile

public void saveFile(java.io.File file,
                     java.lang.String uri)
              throws org.weblab_project.core.exception.WebLabCheckedException
Add new file to the content manager (copy it to the internal repository)

Parameters:
file - file to copy
uri - identify the future content
Throws:
org.weblab_project.core.exception.WebLabCheckedException

saveContent

public void saveContent(org.weblab_project.core.model.content.Content content)
                 throws org.weblab_project.core.exception.WebLabCheckedException
Description copied from class: FolderContentManager
Save the content.

Specified by:
saveContent in class FolderContentManager
Parameters:
content - The content to be saved.
Throws:
org.weblab_project.core.exception.WebLabCheckedException - most of time an access problem.

getInstance

public static BinaryFolderContentManager getInstance(java.lang.String folderPath)
                                              throws org.weblab_project.core.exception.WebLabUncheckedException
Parameters:
folderPath - The path to the folder.
Returns:
The BinaryFolderContentManager
Throws:
org.weblab_project.core.exception.WebLabUncheckedException

getInstance

public static BinaryFolderContentManager getInstance()
                                              throws org.weblab_project.core.exception.WebLabUncheckedException
Returns:
The BinaryFolderContentManager
Throws:
org.weblab_project.core.exception.WebLabUncheckedException


Copyright © 2004-2011. All Rights Reserved.