org.alfresco.repo.avm
Class PlainFileNodeImpl

java.lang.Object
  extended by org.alfresco.repo.avm.AVMNodeImpl
      extended by org.alfresco.repo.avm.PlainFileNodeImpl
All Implemented Interfaces:
AVMNode, FileNode, PlainFileNode

public class PlainFileNodeImpl
extends AVMNodeImpl
implements PlainFileNode

A plain old file. Contains a Content object.


Field Summary
 
Fields inherited from class org.alfresco.repo.avm.AVMNodeImpl
DEBUG
 
Constructor Summary
PlainFileNodeImpl()
          Default constructor.
PlainFileNodeImpl(AVMStore store)
          Make one from just an AVMStore.
PlainFileNodeImpl(AVMStore store, BasicAttributes attrs, org.alfresco.service.cmr.repository.ContentData content, java.util.Map props, java.util.Set aspects, Acl acl, int versionID, Acl parentAcl, ACLCopyMode mode)
          Construct a new one.
PlainFileNodeImpl(PlainFileNode other, AVMStore store, java.lang.Long parentAcl, ACLCopyMode mode)
          Copy on write constructor.
 
Method Summary
 AVMNode copy(org.alfresco.repo.avm.Lookup lPath)
          Copy on write logic.
 org.alfresco.service.cmr.repository.ContentData getContentData()
          

If the content URL contains the special prefix, PREFIX_CONTENT_DATA_ID, then the data is pulled directly from the ContentDataDAO.

 org.alfresco.service.cmr.repository.ContentData getContentData(org.alfresco.repo.avm.Lookup lPath)
          Get the ContentData for this file.
 java.lang.Long getContentDataId()
          Get the ID of the ContentData as given by the string in the ContentURL of form ID:12345
 java.lang.String getContentURL()
          DAO accessor only.
 AVMNodeDescriptor getDescriptor(org.alfresco.repo.avm.Lookup lPath)
          Get the descriptor for this node.
 AVMNodeDescriptor getDescriptor(org.alfresco.repo.avm.Lookup lPath, java.lang.String name)
          Get the descriptor for this node.
 AVMNodeDescriptor getDescriptor(java.lang.String parentPath, java.lang.String name, java.lang.String parentIndirection, int parentIndirectionVersion)
          Get the descriptor for this.
 java.lang.String getEncoding()
          DAO accessor only.
 long getLength()
          DAO accessor only.
 java.lang.String getMimeType()
          DAO accessor only.
 int getType()
          Get the type of this node.
 boolean isLegacyContentData()
          Checks the content URL and if it contains the prefix indicating the an new ContentData storage ID, returns true.
 void setContentData(org.alfresco.service.cmr.repository.ContentData contentData)
          Set the ContentData for this file.
 void setContentURL(java.lang.String contentURL)
          DAO accessor only.
 void setEncoding(java.lang.String encoding)
          DAO accessor only.
 void setLength(long length)
          DAO accessor only.
 void setMimeType(java.lang.String mimeType)
          DAO accessor only.
 java.lang.String toString(org.alfresco.repo.avm.Lookup lPath)
          Get a diagnostic string representation.
 
Methods inherited from class org.alfresco.repo.avm.AVMNodeImpl
addAspect, addProperties, changeAncestor, checkReadOnly, copyACLs, copyACLs, copyACLs, copyACLs, copyAspects, copyCreationAndOwnerBasicAttributes, copyMetaDataFrom, copyProperties, deleteProperties, deleteProperty, equals, getAcl, getAncestor, getAspects, getBasicAttributes, getGuid, getId, getIsNew, getIsRoot, getMergedFrom, getProperties, getProperty, getStoreNew, getVers, getVersionID, hashCode, removeAspect, setAcl, setAncestor, setAspects, setBasicAttributes, setGuid, setId, setIsRoot, setMergedFrom, setProperties, setProperty, setStoreNew, setVers, setVersionID, toString, updateModTime
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.alfresco.repo.avm.AVMNode
addAspect, addProperties, changeAncestor, copyACLs, copyACLs, copyMetaDataFrom, deleteProperties, deleteProperty, getAcl, getAncestor, getAspects, getBasicAttributes, getGuid, getId, getIsNew, getIsRoot, getMergedFrom, getProperties, getProperty, getStoreNew, getVersionID, removeAspect, setAcl, setAncestor, setGuid, setIsRoot, setMergedFrom, setProperties, setProperty, setStoreNew, setVersionID, updateModTime
 

Constructor Detail

PlainFileNodeImpl

public PlainFileNodeImpl()
Default constructor.


PlainFileNodeImpl

public PlainFileNodeImpl(AVMStore store)
Make one from just an AVMStore. This is the constructor used when a brand new plain file is being made.

Parameters:
store - An AVMStore.

PlainFileNodeImpl

public PlainFileNodeImpl(PlainFileNode other,
                         AVMStore store,
                         java.lang.Long parentAcl,
                         ACLCopyMode mode)
Copy on write constructor.

Parameters:
other - The node we are being copied from.
store - The AVMStore.

PlainFileNodeImpl

public PlainFileNodeImpl(AVMStore store,
                         BasicAttributes attrs,
                         org.alfresco.service.cmr.repository.ContentData content,
                         java.util.Map props,
                         java.util.Set aspects,
                         Acl acl,
                         int versionID,
                         Acl parentAcl,
                         ACLCopyMode mode)
Construct a new one. This is called when a LayeredFileNode is copied.

Parameters:
store -
attrs -
content -
Method Detail

copy

public AVMNode copy(org.alfresco.repo.avm.Lookup lPath)
Copy on write logic.

Specified by:
copy in interface AVMNode
Parameters:
lPath - The lookup path.
Returns:
A copy of ourself or null if no copy was necessary.

getType

public int getType()
Get the type of this node.

Specified by:
getType in interface AVMNode
Returns:
The type.

toString

public java.lang.String toString(org.alfresco.repo.avm.Lookup lPath)
Get a diagnostic string representation.

Specified by:
toString in interface AVMNode
Parameters:
lPath - The Lookup.
Returns:
A diagnostic String representation.

getDescriptor

public AVMNodeDescriptor getDescriptor(org.alfresco.repo.avm.Lookup lPath,
                                       java.lang.String name)
Get the descriptor for this node.

Specified by:
getDescriptor in interface AVMNode
Parameters:
lPath - The Lookup.
name - The name of this in the current context.
Returns:
A descriptor.

getDescriptor

public AVMNodeDescriptor getDescriptor(org.alfresco.repo.avm.Lookup lPath)
Get the descriptor for this node.

Specified by:
getDescriptor in interface AVMNode
Parameters:
lPath - The Lookup.
Returns:
A descriptor.

getDescriptor

public AVMNodeDescriptor getDescriptor(java.lang.String parentPath,
                                       java.lang.String name,
                                       java.lang.String parentIndirection,
                                       int parentIndirectionVersion)
Get the descriptor for this.

Specified by:
getDescriptor in interface AVMNode
Parameters:
parentPath - The parent path.
name - The name this was looked up with.
parentIndirection - The parent indirection.
parentIndirectionVersion - The indirection version of the parent.
Returns:
The descriptor for this.

getContentURL

public java.lang.String getContentURL()
DAO accessor only. DO NOT USE in code.

Specified by:
getContentURL in interface PlainFileNode

setContentURL

public void setContentURL(java.lang.String contentURL)
DAO accessor only. DO NOT USE in code.


getMimeType

public java.lang.String getMimeType()
DAO accessor only. DO NOT USE in code.

Specified by:
getMimeType in interface PlainFileNode

setMimeType

public void setMimeType(java.lang.String mimeType)
DAO accessor only. DO NOT USE in code.


getEncoding

public java.lang.String getEncoding()
DAO accessor only. DO NOT USE in code.

Specified by:
getEncoding in interface PlainFileNode

setEncoding

public void setEncoding(java.lang.String encoding)
DAO accessor only. DO NOT USE in code.


getLength

public long getLength()
DAO accessor only. DO NOT USE in code.

Specified by:
getLength in interface PlainFileNode

setLength

public void setLength(long length)
DAO accessor only. DO NOT USE in code.


setContentData

public void setContentData(org.alfresco.service.cmr.repository.ContentData contentData)
Set the ContentData for this file.

Specified by:
setContentData in interface FileNode
Specified by:
setContentData in interface PlainFileNode
Parameters:
contentData - The value to set.

getContentData

public org.alfresco.service.cmr.repository.ContentData getContentData(org.alfresco.repo.avm.Lookup lPath)
Get the ContentData for this file.

Specified by:
getContentData in interface FileNode
Parameters:
lPath - The lookup path used to get here. Unused here.
Returns:
The ContentData object for this file.

getContentData

public org.alfresco.service.cmr.repository.ContentData getContentData()

If the content URL contains the special prefix, PREFIX_CONTENT_DATA_ID, then the data is pulled directly from the ContentDataDAO.

Specified by:
getContentData in interface PlainFileNode

isLegacyContentData

public boolean isLegacyContentData()
Checks the content URL and if it contains the prefix indicating the an new ContentData storage ID, returns true.

Specified by:
isLegacyContentData in interface PlainFileNode

getContentDataId

public java.lang.Long getContentDataId()
Get the ID of the ContentData as given by the string in the ContentURL of form ID:12345

Specified by:
getContentDataId in interface PlainFileNode


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.