Package java.io

Examples of java.io.FileNotFoundException


      if (s_log.isDebugEnabled())
      {
        s_log.debug("downloadHttpFile: response code was: " + resultCode);
      }

      if (resultCode != 200) { throw new FileNotFoundException("Failed to download file from url (" + url
        + "): HTTP Response Code=" + resultCode); }
      InputStream mis = method.getResponseBodyAsStream();

      is = new BufferedInputStream(mis);
View Full Code Here


  public void load(File xmlFile, ClassLoader cl)
    throws FileNotFoundException, XMLException
  {
    if (!xmlFile.exists())
    {
      throw new FileNotFoundException(xmlFile.getName());
    }
    load(xmlFile.getAbsolutePath(), cl);
  }
View Full Code Here

   */
  public static Object loadObject(File file) throws JRException
  {
    if (!file.exists() || !file.isFile())
    {
      throw new JRException( new FileNotFoundException(String.valueOf(file)) );
    }

    Object obj = null;

    FileInputStream fis = null;
View Full Code Here

   */
  public static InputStream getInputStream(File file) throws JRException
  {
    if (!file.exists() || !file.isFile())
    {
      throw new JRException( new FileNotFoundException(String.valueOf(file)) );
    }

    FileInputStream fis = null;

    try
View Full Code Here

    URL getBaseUrl() throws IOException {
      // Find URL pointing to Finalizer.class file.
      String finalizerPath = FINALIZER_CLASS_NAME.replace('.', '/') + ".class";
      URL finalizerUrl = getClass().getClassLoader().getResource(finalizerPath);
      if (finalizerUrl == null) {
        throw new FileNotFoundException(finalizerPath);
      }

      // Find URL pointing to base of class path.
      String urlString = finalizerUrl.toString();
      if (!urlString.endsWith(finalizerPath)) {
View Full Code Here

         {
            vf = getCachedVirtualFile(matchingNames.get(0));
         }
         else if(matchingNames.size() > 1)
         {
            throw new FileNotFoundException("Multiple names found for name: " + name + ", profile: "+ key + ", available: " + matchingNames);
         }
      }
      if(vf == null)
         throw new FileNotFoundException("Failed to find content in profile: "+ key + " filename: " + name);
     
      return vf;
   }
View Full Code Here

      try
      {
         // Write the content out
         File contentRoot = new File(getUploadUri());
         if(contentRoot == null)
            throw new FileNotFoundException("Failed to obtain content dir for phase: "+vfsPath);
         if(contentRoot.isDirectory() == false)
            throw new FileNotFoundException("The content root is not a directory." + contentRoot.getAbsolutePath());
         // The content file
         File contentFile = new File(contentRoot, vfsPath);
        
         // Check if it already exists
         boolean exists = contentFile.exists();
View Full Code Here

   * @since Guava release 02
   */
  public static MappedByteBuffer map(File file, MapMode mode)
      throws IOException {
    if (!file.exists()) {
      throw new FileNotFoundException(file.toString());
    }
    return map(file, mode, file.length());
  }
View Full Code Here

      assertTrue(Arrays.equals(expectedTrace, e.getStackTrace()));
    }
  }

  public void testGetCausalChain() {
    FileNotFoundException fnfe = new FileNotFoundException();
    IllegalArgumentException iae = new IllegalArgumentException(fnfe);
    RuntimeException re = new RuntimeException(iae);
    IllegalStateException ex = new IllegalStateException(re);

    assertEquals(asList(ex, re, iae, fnfe), Throwables.getCausalChain(ex));
View Full Code Here

            this.jarFile = new JarFile(tmpFile);
         }
         catch(IOException e)
         {
            tmpFile.renameTo(file);
            throw new FileNotFoundException("Not a JarFile: "+file);
         }

         Manifest tmpMf = jarFile.getManifest();
         this.mf = tmpMf == null ? new Manifest() : tmpMf;
         Attributes mfAttrs = mf.getMainAttributes();
View Full Code Here

TOP

Related Classes of java.io.FileNotFoundException

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.