Search in sources :

Example 1 with Directory

use of digilib.io.Directory in project digilib by robcast.

the class IndexMetaDirMeta method readParentMeta.

/**
 * Read metadata from all known parent directories.
 * @param dir
 */
public void readParentMeta(DocuDirectory dir) {
    // check the parent directories for additional file meta
    Directory pd = dir.getParent();
    String path = dir.getDir().getName();
    while (pd != null) {
        DocuDirectory dd = (DocuDirectory) pd;
        dd.checkMeta();
        IndexMetaDirMeta dm = (IndexMetaDirMeta) dd.getMeta();
        if (dm.hasUnresolvedFileMeta()) {
            readFileMeta(dir, dm.getUnresolvedFileMeta(), path);
        }
        // prepend parent dir path
        path = pd.getDir().getName() + "/" + path;
        // become next parent
        pd = pd.getParent();
    }
}
Also used : DocuDirectory(digilib.io.DocuDirectory) DocuDirectory(digilib.io.DocuDirectory) Directory(digilib.io.Directory)

Aggregations

Directory (digilib.io.Directory)1 DocuDirectory (digilib.io.DocuDirectory)1