Examples of FileResource


Examples of org.carrot2.util.resource.FileResource

    }

    @Test
    public void testFileResource() throws Exception
    {
        check(new FileResource(new File(".").getAbsoluteFile()));
    }
View Full Code Here

Examples of org.cast.cwm.xml.FileResource

    } else { // when the glossary is on
      Resource glossaryResource;
      if (davServer != null) {
        glossaryResource = new DavResource(davServer, getContentDir() + "/" + glossaryFileName);
      } else {
        glossaryResource = new FileResource(new File(getContentDir(), glossaryFileName));
      }
      final XmlDocument glossaryDoc = xmlService.loadXmlDocument("glossary", glossaryResource, new DtbookParser(), null);
     
      // Set up Glossary
      Databinder.ensureSession(new SessionUnit() {
        public Object run(Session sess) {
          glossary = GlossaryService.get().parseXmlGlossaryDocument(glossaryDoc);
          return null;
        }
      });
    }
       
    // Load student content files
    String fileList = appProperties.getProperty("isi.studentContentFiles", DEFAULT_STUDENT_CONTENT_FILE_NAMES).trim();
    studentContentFiles = fileList.split("\\s*,\\s*");   
    documentObservers.add(new XmlDocumentObserver(getSectionElement(), getPageElement())); // Use set so sub-classed applications can add to it as well
    for (String file : studentContentFiles) {
      Resource resource;
      if (davServer != null) {
        log.debug("attempting to load DavResource file = {}", getContentDir() + "/" + file);
        log.debug("loading the DavResource on the Server = {}", davServer);
        resource = new DavResource(davServer, getContentDir() + "/" + file);
      } else {
        log.debug("attempting to load Resource file = {}", getContentDir() + "/" + file);
        resource = new FileResource(new File(getContentDir(), file));
      }
      XmlDocument doc = xmlService.loadXmlDocument(file, resource, new DtbookParser(), documentObservers);
      studentContent.add(doc);
    }
   
    // Load email content files
    if (emailOn) {
      String emailFileName = EMAIL_FILE_NAME;         
      Resource emailResource;
      if (davServer != null) {
        emailResource = new DavResource(davServer, getContentDir() + "/" + emailFileName);
      } else {
        emailResource = new FileResource(new File(getContentDir(), emailFileName));
      }
      emailContent = xmlService.loadXmlDocument("email", emailResource, new DtbookParser(), null);         
    }
    log.debug("Finished loading ISI XML Files");
  }
View Full Code Here

Examples of org.codehaus.janino.util.resource.FileResource

     */
    public boolean compile(File[] sourceFiles) throws CompileException, IOException {
        this.benchmark.report("Source files", sourceFiles);

        Resource[] sourceFileResources = new Resource[sourceFiles.length];
        for (int i = 0; i < sourceFiles.length; ++i) sourceFileResources[i] = new FileResource(sourceFiles[i]);
        this.compile(sourceFileResources);
        return true;
    }
View Full Code Here

Examples of org.eclipse.jetty.util.resource.FileResource

        }

        @Override
        public void parseWebInfClasses(WebAppContext context, AnnotationParser parser) throws Exception
        {
          Resource r = new FileResource(AnnotedServletTest.class.getResource("resources"));
              parser.parse(r , new SimpleResolver());
        }

        @Override
        public void parseWebInfLib(WebAppContext arg0, AnnotationParser arg1) throws Exception
View Full Code Here

Examples of org.exoplatform.services.jcr.webdav.resource.FileResource

               lastModifiedProperty = resource.getProperty(FileResource.GETLASTMODIFIED);
               istream = ((VersionResource)resource).getContentAsStream();
            }
            else
            {
               resource = new FileResource(uri, node, nsContext);
              
               lastModifiedProperty = resource.getProperty(FileResource.GETLASTMODIFIED);
               istream = ((FileResource)resource).getContentAsStream();
            }
View Full Code Here

Examples of org.geowebcache.io.FileResource

    private Resource readFile(File fh) throws StorageException {
        if (!fh.exists()) {
            return null;
        }
        Resource res = new FileResource(fh);
        return res;
    }
View Full Code Here

Examples of org.gradle.api.internal.file.FileResource

        Map<String, Integer> expected = new HashMap<String, Integer>();
        expected.put("dir", 2);
        expected.put("file", 1);

        assertVisitsPermissions(new TarFileTree(new FileResource(tarFile), null, fileSystem()),
                expected);
    }
View Full Code Here

Examples of org.jboss.aesh.io.FileResource

        else if(completeOperation.getBuffer().startsWith("less ")) {

            String word = Parser.findWordClosestToCursor(completeOperation.getBuffer(),
                    completeOperation.getCursor());
            completeOperation.setOffset(completeOperation.getCursor());
            new FileLister(word, new FileResource(System.getProperty("user.dir"))).findMatchingDirectories(completeOperation);
        }
    }
View Full Code Here

Examples of org.jboss.forge.addon.resource.FileResource

   {
      String templateContents = "Hello ${name}!";
      String expected = "Hello JBoss Forge!";
      File tempFile = File.createTempFile("template", ".tmp");
      tempFile.deleteOnExit();
      FileResource resource = resourceFactory.create(tempFile).reify(FileResource.class);
      resource.setContents(templateContents);
      Template template = templateFactory.create(resource, FreemarkerTemplate.class);
      String actual = template.process(Collections.singletonMap("name", "JBoss Forge"));
      Assert.assertEquals(expected, actual);
   }
View Full Code Here

Examples of org.jitterbit.integration.client.entity.settings.FileResource

    @Override
    public DataFilesInfo getCurrentFilesInfo() {
        synchronized (this) {
            if (info == null) {
                FileResource projectResource = getInfoResource();
                if (projectResource.exists()) {
                    try {
                        info = projectResource.deserialize(DataFilesInfo.class);
                    } catch (Exception e) {
                        ErrorLog.log(this, "Corrupt project data.", e);
                        projectResource.delete();
                    }
                }
            }
        }
        return info;
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.