Package java.io

Examples of java.io.File.toURI()


      if (null != fileLocation) {
        File file = new File(fileLocation, localResourcePath);
        log.debug("trying to find {} ({})", file.getAbsolutePath(), file.exists());
        if (file.exists()) {
          log.debug("found {} ({})", file.getAbsolutePath(), file.exists());
          resource = file.toURI().toURL();
        }
      }

      if (resource == null) {
        resource = servletContext.getResource(localResourcePath);
View Full Code Here


      if (null != fileLocation) {
        File file = new File(fileLocation, localResourcePath);
        log.debug("trying to find {} ({})", file.getAbsolutePath(), file.exists());
        if (file.exists()) {
          log.debug("found {} ({})", file.getAbsolutePath(), file.exists());
          resource = file.toURI().toURL();
        }
      }

      if (resource == null) {
        resource = getServletContext().getResource(localResourcePath);
View Full Code Here

      // Next try to locate this as file path
      if (url == null)
      {
         File tst = new File(storeURL);
         if (tst.exists() == true)
            url = tst.toURI().toURL();
      }

      // Last try to locate this as a classpath resource
      if (url == null)
      {
View Full Code Here

         if (outputDir == null)
         {
            if (server != null)
            {
               base =  new File(server.getConfiguration().getServerDataLocation().toURI());              
               outputDir = base.toURI();
            }
         }
         else
         {
            base = new File(outputDir);
View Full Code Here

               writer.println(bootstrapUrl);
               writer.flush();
            }
            catch (Exception e)
            {
               handleOutputFileCreationException(file.toURI(), e);
            }
            finally
            {
               if (writer != null)
               {
View Full Code Here

  public void testaddFeeds() throws Exception {
    FeedManager FM = new FeedManager();

    File inpFile = new File(getDataDir(), "favchannels.opml");
    String opmlUri = inpFile.toURI().toString();
    System.err.println("parsing " + opmlUri);
    Collection feeds = OPMLParser.parse(inpFile);

    Iterator it = feeds.iterator();
View Full Code Here

         {
            File dir = new File(patchURL.getFile());
            if (dir.exists())
            {
               // Add the local file patch directory
               list.add(dir.toURI().toURL());

               // Add the contents of the directory too
               File[] jars = dir.listFiles(new FileSuffixFilter(new String[] { ".jar", ".zip" }, true));

               for (int j = 0; jars != null && j < jars.length; j++)
View Full Code Here

      File xml = File.createTempFile(getClass().getSimpleName(), FILE_SUFFIX);
      // Write template
      writeTemplate(xml, info);
      // Return virtual file
     
      return VFS.getChild(xml.toURI());
   }

   public String getDeploymentName(String deploymentBaseName)
   {
      if(deploymentBaseName == null)
View Full Code Here

            if (file == null || file.exists() == false) {
               // copy to temp location and deploy from there.
               final File temp = File.createTempFile("tmp", getShortName(url.getPath()), getTempDir());
               temp.deleteOnExit();
               copy(url, temp);
               file = VFS.getChild(temp.toURI());
               deploymentName = url.toExternalForm();
            } else {
               deploymentName = file.asFileURI().toString();              
            }
           
View Full Code Here

      rim.setTimestamp(20);
      emptyRRM.getContent().add(rim);
     
      File temp = new File(System.getProperty("java.io.tmpdir"));
     
      JAXBRepositoryContentMetadataPersister testee = new JAXBRepositoryContentMetadataPersister(temp.toURI());
      testee.store("test", rcm);
     
      // Ensure we clean up
      File stored = testee.getMetadataPath("test");
      stored.deleteOnExit();
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.