|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.modeshape.connector.filesystem.FileSystemSource.StandardPropertiesFactory
protected static class FileSystemSource.StandardPropertiesFactory
Constructor Summary | |
---|---|
protected |
FileSystemSource.StandardPropertiesFactory()
|
Method Summary | |
---|---|
protected void |
ensureValidProperties(ExecutionContext context,
String sourceName,
Collection<Property> properties,
Set<Name> validPropertyNames)
Checks that the collection of properties only contains properties with allowable names. |
Collection<Property> |
getDirectoryProperties(ExecutionContext context,
Location location,
File directory)
Construct the custom properties that should be created for the supplied directory that is to be treated as an "nt:folder". |
Collection<Property> |
getFileProperties(ExecutionContext context,
Location location,
File file)
Construct the custom properties that should be created for the supplied file that is to be treated as an "nt:file". |
Collection<Property> |
getResourceProperties(ExecutionContext context,
Location location,
File file,
String mimeType)
Construct the custom properties that should be created for the supplied file that is to be treated as an "nt:resource", which is the node that contains the content-oriented properties and that is a child of a "nt:file" node. |
Set<Name> |
recordDirectoryProperties(ExecutionContext context,
String sourceName,
Location location,
File file,
Map<Name,Property> properties)
Record the supplied properties as being set on the designated "nt:folder" node. |
Set<Name> |
recordFileProperties(ExecutionContext context,
String sourceName,
Location location,
File file,
Map<Name,Property> properties)
Record the supplied properties as being set on the designated "nt:file" node. |
Set<Name> |
recordResourceProperties(ExecutionContext context,
String sourceName,
Location location,
File file,
Map<Name,Property> properties)
Record the supplied properties as being set on the designated "nt:resource" node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected FileSystemSource.StandardPropertiesFactory()
Method Detail |
---|
public Collection<Property> getDirectoryProperties(ExecutionContext context, Location location, File directory)
CustomPropertiesFactory
JcrLexicon.PRIMARY_TYPE
or JcrLexicon.CREATED
properties, which are set automatically and will override any returned Property with the same name.
getDirectoryProperties
in interface CustomPropertiesFactory
context
- the execution context; never nulllocation
- the Location of the node, which always contains a path
; never nulldirectory
- the file system object; never null and File.isDirectory()
will always return true
public Collection<Property> getFileProperties(ExecutionContext context, Location location, File file)
CustomPropertiesFactory
JcrLexicon.PRIMARY_TYPE
or JcrLexicon.CREATED
properties, which are set automatically and will override any returned Property with the same name.
Although the connector does not automatically determine the MIME type for the "nt:file" nodes, an implementation can
determine the MIME type by using the context's MIME type detector
. Note,
however, that this may be an expensive operation, so it should be used only when needed.
getFileProperties
in interface CustomPropertiesFactory
context
- the execution context; never nulllocation
- the Location of the node, which always contains a path
; never nullfile
- the file system object; never null and File.isFile()
will always return true
public Collection<Property> getResourceProperties(ExecutionContext context, Location location, File file, String mimeType)
CustomPropertiesFactory
JcrLexicon.PRIMARY_TYPE
, JcrLexicon.LAST_MODIFIED
, or
JcrLexicon.DATA
properties, which are set automatically and will override any returned Property with the same name.
getResourceProperties
in interface CustomPropertiesFactory
context
- the execution context; never nulllocation
- the Location of the node, which always contains a path
; never nullfile
- the file system object; never null and File.isFile()
will always return truemimeType
- the mime type for the file, as determined by the MIME type
detector
, or null if the MIME type could not be determined
public Set<Name> recordDirectoryProperties(ExecutionContext context, String sourceName, Location location, File file, Map<Name,Property> properties) throws RepositorySourceException
recordDirectoryProperties
in interface CustomPropertiesFactory
context
- the execution context; never nullsourceName
- the name of the repository source; never nulllocation
- the Location of the node, which always contains a path
; never nullfile
- the file system object; never null, and both File.exists()
and File.isDirectory()
will always
return trueproperties
- the properties that are to be set
RepositorySourceException
- if any properties are invalid or cannot be set on these nodesCustomPropertiesFactory.recordDirectoryProperties(org.modeshape.graph.ExecutionContext,
java.lang.String, org.modeshape.graph.Location, java.io.File, java.util.Map)
public Set<Name> recordFileProperties(ExecutionContext context, String sourceName, Location location, File file, Map<Name,Property> properties) throws RepositorySourceException
recordFileProperties
in interface CustomPropertiesFactory
context
- the execution context; never nullsourceName
- the name of the repository source; never nulllocation
- the Location of the node, which always contains a path
; never nullfile
- the file system object; never null, and both File.exists()
and File.isFile()
will always return
trueproperties
- the properties that are to be set
RepositorySourceException
- if any properties are invalid or cannot be set on these nodesCustomPropertiesFactory.recordFileProperties(org.modeshape.graph.ExecutionContext,
java.lang.String, org.modeshape.graph.Location, java.io.File, java.util.Map)
public Set<Name> recordResourceProperties(ExecutionContext context, String sourceName, Location location, File file, Map<Name,Property> properties) throws RepositorySourceException
recordResourceProperties
in interface CustomPropertiesFactory
context
- the execution context; never nullsourceName
- the name of the repository source; never nulllocation
- the Location of the node, which always contains a path
; never nullfile
- the file system object; never null, and both File.exists()
and File.isFile()
will always return
trueproperties
- the properties that are to be set
RepositorySourceException
- if any properties are invalid or cannot be set on these nodesCustomPropertiesFactory.recordResourceProperties(org.modeshape.graph.ExecutionContext,
java.lang.String, org.modeshape.graph.Location, java.io.File, java.util.Map)
protected void ensureValidProperties(ExecutionContext context, String sourceName, Collection<Property> properties, Set<Name> validPropertyNames)
properties
only contains properties with allowable names.
context
- sourceName
- properties
- validPropertyNames
-
RepositorySourceException
- if properties
contains aALLOWABLE_PROPERTIES_FOR_CONTENT
,
ALLOWABLE_PROPERTIES_FOR_FILE_OR_FOLDER
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |