src/main/java/com/googlecode/fascinator/harvester/workflow/WorkflowHarvester.java
private String createDigitalObject(File file) throws HarvesterException,
            StorageException {
        String objectId;
        DigitalObject object;
        if (forceUpdate) {
            object = StorageUtils.storeFile(getStorage(), file,
                    !forceLocalStorage);
        } else {
            String oid = StorageUtils.generateOid(file);
            String pid = StorageUtils.generatePid(file);
            object = getStorage().createObject(oid);
            if (forceLocalStorage) {
                try {
                    object.createStoredPayload(pid, new FileInputStream(file));
                } catch (FileNotFoundException ex) {
                    throw new HarvesterException(ex);
                }
            } else {
                object.createLinkedPayload(pid, file.getAbsolutePath());
            }

        }
        // update object metadata
        Properties props = object.getMetadata();
        props.setProperty("render-pending", "true");
        props.setProperty("file.path",
                FilenameUtils.separatorsToUnix(file.getAbsolutePath()));
        objectId = object.getId();

        // Store rendition information if we have it
        String ext = FilenameUtils.getExtension(file.getName());
        for (String chain : renderChains.keySet()) {
            Map<String, List<String>> details = renderChains.get(chain);
            if (details.get("fileTypes").contains(ext)) {
                storeList(props, details, "harvestQueue");
                storeList(props, details, "indexOnHarvest");
                storeList(props, details, "renderQueue");
            }
        }

        object.close();
        return objectId;
    }
private String createDigitalObject(File file) throws HarvesterException,
            StorageException {
        String objectId;
        DigitalObject object;
        if (forceUpdate) {
            object = StorageUtils.storeFile(getStorage(), file,
                    !forceLocalStorage);
        } else {
            String oid = StorageUtils.generateOid(file);
            String pid = StorageUtils.generatePid(file);
            object = getStorage().createObject(oid);
            if (forceLocalStorage) {
                try {
                    object.createStoredPayload(pid, new FileInputStream(file));
                } catch (FileNotFoundException ex) {
                    throw new HarvesterException(ex);
                }
            } else {
                object.createLinkedPayload(pid, file.getAbsolutePath());
            }

        }
        // update object metadata
        Properties props = object.getMetadata();
        props.setProperty("render-pending", "true");
        props.setProperty("file.path",
                FilenameUtils.separatorsToUnix(file.getAbsolutePath()));
        objectId = object.getId();

        // Store rendition information if we have it
        String ext = FilenameUtils.getExtension(file.getName());
        for (String chain : renderChains.keySet()) {
            Map<String, List<String>> details = renderChains.get(chain);
            if (details.get("fileTypes").contains(ext)) {
                storeList(props, details, "harvestQueue");
                storeList(props, details, "indexOnHarvest");
                storeList(props, details, "renderQueue");
            }
        }

        object.close();
        return objectId;
    }
private String createDigitalObject ( File file ) throws HarvesterException , StorageException { String objectId ; DigitalObject object ; if ( forceUpdate ) { object = StorageUtils . storeFile ( getStorage ( ) , file , ! forceLocalStorage ) ; } else { String oid = StorageUtils . generateOid ( file ) ; String pid = StorageUtils . generatePid ( file ) ; object = getStorage ( ) . createObject ( oid ) ; if ( forceLocalStorage ) { try { object . createStoredPayload ( pid , new FileInputStream ( file ) ) ; } catch ( FileNotFoundException ex ) { throw new HarvesterException ( ex ) ; } } else { object . createLinkedPayload ( pid , file . getAbsolutePath ( ) ) ; } } // update object metadata Properties props = object . getMetadata ( ) ; props . setProperty ( "render-pending" , "true" ) ; props . setProperty ( "file.path" , FilenameUtils . separatorsToUnix ( file . getAbsolutePath ( ) ) ) ; objectId = object . getId ( ) ; // Store rendition information if we have it String ext = FilenameUtils . getExtension ( file . getName ( ) ) ; for ( String chain : renderChains . keySet ( ) ) { Map < String , List < String > > details = renderChains . get ( chain ) ; if ( details . get ( "fileTypes" ) . contains ( ext ) ) { storeList ( props , details , "harvestQueue" ) ; storeList ( props , details , "indexOnHarvest" ) ; storeList ( props , details , "renderQueue" ) ; } } object . close ( ) ; return objectId ; }
Store the provided file in storage. Ensure proper queue routing is set
in object properties.

@param file : The file to store
@return String : The OID of the stored object
@throws HarvesterException : if there was an error accessing storage
@throws StorageException : if there was an error writing to storage
Store the provided file in storage . Ensure proper queue routing is set in object properties .