Package org.olat.core.util.vfs

Examples of org.olat.core.util.vfs.VFSContainer.resolve()


              valid = itemIds.isEmpty(); //empty podcast
            } else {
              int validItemsCount = 0;
              for (String itemId : itemIds) {
                // Try loading each item
                VFSItem itemContainer = itemsContainer.resolve(itemId);
                Item item = FeedManagerImpl.loadItem(itemContainer);
                if (item != null) {
                  // This item is valid, increase the counter
                  validItemsCount++;
                }
View Full Code Here


   */
  public static boolean validate(File unzippedDir) {
    // with VFS FIXME:pb:c: remove casts to LocalFileImpl and LocalFolderImpl if
    // no longer needed.
    VFSContainer vfsUnzippedRoot = new LocalFolderImpl(unzippedDir);
    VFSItem vfsQTI = vfsUnzippedRoot.resolve("qti.xml");
    // getDocument(..) ensures that InputStream is closed in every case.
    Document doc = QTIHelper.getDocument((LocalFileImpl) vfsQTI);
    // if doc is null an error loading the document occured
    if (doc == null) return false;
    // check if this is marked as test
View Full Code Here

      if (zipName != null && zipName.endsWith(".zip")) {
        zipFileName = zipName;
      }
    }
    // delete old archive and create new one
    VFSItem oldArchive = oresRoot.resolve(zipFileName);
    if (oldArchive != null) {
      oldArchive.delete();
    }
    ZipUtil.zip(cpRoot.getItems(), oresRoot.createChildLeaf(zipFileName));
    VFSLeaf zip = (VFSLeaf) oresRoot.resolve(zipFileName);
View Full Code Here

    VFSItem oldArchive = oresRoot.resolve(zipFileName);
    if (oldArchive != null) {
      oldArchive.delete();
    }
    ZipUtil.zip(cpRoot.getItems(), oresRoot.createChildLeaf(zipFileName));
    VFSLeaf zip = (VFSLeaf) oresRoot.resolve(zipFileName);
    return zip;
  }

  /**
   *
 
View Full Code Here

    File unzippedRoot = frm.unzipFileResource(res);
   

    //with VFS FIXME:pb:c: remove casts to LocalFileImpl and LocalFolderImpl if no longer needed.
    VFSContainer vfsUnzippedRoot = new LocalFolderImpl(unzippedRoot);
    VFSItem vfsQTI = vfsUnzippedRoot.resolve("qti.xml");
    //getDocument(..) ensures that InputStream is closed in every case.
    Document doc = QTIHelper.getDocument((LocalFileImpl) vfsQTI);
    //if doc is null an error loading the document occured (IOException, qti.xml does not exist)
    if (doc == null) return;
   
View Full Code Here

   * @see org.olat.ims.qti.process.Resolver#getObjectBank(java.lang.String)
   */
  public Element getObjectBank(String ident) { 
    //with VFS FIXME:pb:c: remove casts to LocalFileImpl and LocalFolderImpl if no longer needed.
    VFSContainer vfsUnzippedRoot = new LocalFolderImpl(fUnzippedDirRoot);
    VFSItem vfsQTI = vfsUnzippedRoot.resolve(ident + ".xml");
    //getDocument(..) ensures that InputStream is closed in every case.
    Document theDoc = QTIHelper.getDocument((LocalFileImpl) vfsQTI);
    //if doc is null an error loading the document occured (IOException, qti.xml does not exist)
    if (theDoc == null) return null;
    Element objectBank = (Element) theDoc.selectSingleNode("questestinterop/objectbank");
View Full Code Here

   * @see org.olat.ims.qti.process.Resolver#getQTIDocument()
   */
  public Document getQTIDocument() {
    //with VFS FIXME:pb:c: remove casts to LocalFileImpl and LocalFolderImpl if no longer needed.
    VFSContainer vfsUnzippedRoot = new LocalFolderImpl(fUnzippedDirRoot);
    VFSItem vfsQTI = vfsUnzippedRoot.resolve(QTI_FILE);
    //getDocument(..) ensures that InputStream is closed in every case.
    Document theDoc = QTIHelper.getDocument((LocalFileImpl) vfsQTI);
    //if doc is null an error loading the document occured (IOException, qti.xml does not exist)
    return theDoc;
  }
View Full Code Here

  /**
   * @see org.olat.ims.qti.process.Resolver#hasAutocompleteFiles()
   */
  public boolean hasAutocompleteFiles() {
    VFSContainer vfsUnzippedRoot = new LocalFolderImpl(fUnzippedDirRoot);
    VFSItem vfsAutocompleteJsItem = vfsUnzippedRoot.resolve(QTI_FIB_AUTOCOMPLETE_JS_FILE);
    if (vfsAutocompleteJsItem != null) {
      VFSItem vfsAutocompleteCssItem = vfsUnzippedRoot.resolve(QTI_FIB_AUTOCOMPLETE_CSS_FILE);
      if (vfsAutocompleteCssItem != null) {
        return true;
      }
View Full Code Here

   */
  public boolean hasAutocompleteFiles() {
    VFSContainer vfsUnzippedRoot = new LocalFolderImpl(fUnzippedDirRoot);
    VFSItem vfsAutocompleteJsItem = vfsUnzippedRoot.resolve(QTI_FIB_AUTOCOMPLETE_JS_FILE);
    if (vfsAutocompleteJsItem != null) {
      VFSItem vfsAutocompleteCssItem = vfsUnzippedRoot.resolve(QTI_FIB_AUTOCOMPLETE_CSS_FILE);
      if (vfsAutocompleteCssItem != null) {
        return true;
      }
    }
    return false;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.