org.entityfs.cap.metadata.impl
Class MetadataImplUtil

java.lang.Object
  extended by org.entityfs.cap.metadata.impl.MetadataImplUtil

public final class MetadataImplUtil
extends Object

Utility class with static utility methods for metadata capability implementations.

Since:
1.0
Author:
Karl Gustafsson
In_jar:
entityfs-metadata

Method Summary
static void copyAllMetadata(MetadataEnablingEntityDelegate source, MetadataEnablingEntityDelegate dest)
          Copy all metadata from the source entity delegate to the dest entity delegate.
static Set<EntityImplementation> copyMetadataToFiles(MetadataEnablingEntityDelegate ecn, DirectoryImplementation targetDir, String filePrefix)
          Copy all metadata to files in the supplied directory.
static void replaceTargetMetadataFilesWithFilesFromThisDelegate(MetadataEnablingEntityDelegate d, EntityImplementation target, int bufSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

copyAllMetadata

public static void copyAllMetadata(MetadataEnablingEntityDelegate source,
                                   MetadataEnablingEntityDelegate dest)
Copy all metadata from the source entity delegate to the dest entity delegate.

Parameters:
source - The source entity delegate.
dest - The destination entity delegate.

copyMetadataToFiles

public static Set<EntityImplementation> copyMetadataToFiles(MetadataEnablingEntityDelegate ecn,
                                                            DirectoryImplementation targetDir,
                                                            String filePrefix)
                                                     throws WrappedIOException
Copy all metadata to files in the supplied directory.

Parameters:
ecn - The metadata collection object.
targetDir - The target directory. Must be locked for writing.
filePrefix - The prefix to use for the names of the created files.
Returns:
The set of created file entities.
Throws:
WrappedIOException - On I/O errors.

replaceTargetMetadataFilesWithFilesFromThisDelegate

public static void replaceTargetMetadataFilesWithFilesFromThisDelegate(MetadataEnablingEntityDelegate d,
                                                                       EntityImplementation target,
                                                                       int bufSize)
Parameters:
d -
target - Must support the ECTNamedMetadata capability type.