Package org.olat.core.util.vfs

Examples of org.olat.core.util.vfs.LocalFolderImpl


    FileResourceManager frm = FileResourceManager.getInstance();
    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

   *
   * @return qti changelog messages or an empty array if no changelog exists.
   * @see QTIChangeLogMessage
   */
  public QTIChangeLogMessage[] getDocumentChangeLog() {
    VFSContainer dirRoot = new LocalFolderImpl(fUnzippedDirRoot);
    VFSContainer dirChangelog = (VFSContainer) dirRoot.resolve("changelog");
    if (dirChangelog == null) {
      // no change log
      return new QTIChangeLogMessage[0];
    }
    List items = dirChangelog.getItems();
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;
      }
    }
    return false;
View Full Code Here

    File glossaryFolderFile = new File(glossaryFolderString);
    if (!glossaryFolderFile.isDirectory()) {
      logWarn("GlossaryTerms delivery failed; path to glossaryFolder not existing: " + relPath, null);
      return new NotFoundMediaResource(relPath);
    }
    VFSContainer glossaryFolder = new LocalFolderImpl(glossaryFolderFile);
    if (!gIM.isFolderContainingGlossary(glossaryFolder)) {
      logWarn("GlossaryTerms delivery failed; glossaryFolder doesn't contain a valid Glossary: " + glossaryFolder, null);
      return new NotFoundMediaResource(relPath);
    }
View Full Code Here

    File glossaryFolderFile = new File(glossaryFolderString);
    if (!glossaryFolderFile.isDirectory()) {
      logWarn("GlossaryDefinition delivery failed; path to glossaryFolder not existing: " + relPath, null);
      return new NotFoundMediaResource(relPath);
    }
    VFSContainer glossaryFolder = new LocalFolderImpl(glossaryFolderFile);
    if (!gIM.isFolderContainingGlossary(glossaryFolder)) {
      logWarn("GlossaryDefinition delivery failed; glossaryFolder doesn't contain a valid Glossary: " + glossaryFolder, null);
      return new NotFoundMediaResource(relPath);
    }
View Full Code Here

TOP

Related Classes of org.olat.core.util.vfs.LocalFolderImpl

Copyright © 2018 www.massapicom. 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.