Package java.io

Examples of java.io.FileNotFoundException


    // Execute the method.
    int statusCode = method.execute();

    if (statusCode == 404)
      throw new FileNotFoundException(url + " " + method.getStatusLine());

    if (statusCode >= 300)
      throw new IOException(url + " " + method.getStatusLine());

    if (debugDetails) {
View Full Code Here


   */
  public boolean populateFromResource(String resourceLocation, NetcdfFile target) throws IOException {
    ClassLoader cl = this.getClass().getClassLoader();
    InputStream is = cl.getResourceAsStream(resourceLocation);
    if (is == null)
      throw new FileNotFoundException(resourceLocation);
    return populate(is, target);
  }
View Full Code Here

    File oFile = new File(sFilePath);

    if (oFile==null) {
      if (DebugFile.trace) DebugFile.decIdent();
      throw new FileNotFoundException(sFilePath);
    }
    if (!oFile.exists()) {
      if (DebugFile.trace) DebugFile.decIdent();
      throw new FileNotFoundException(sFilePath);
    }

    PreparedStatement oStmt = oConn.prepareStatement("INSERT INTO " + DB.k_duties_attach + "(" + DB.gu_duty + "," + DB.tx_file + "," + DB.len_file + "," + DB.bin_file + ") VALUES (?,?,?,?)");

    int iFileLen = new Long(oFile.length()).intValue();
View Full Code Here

    try {
      sHtml = oFS.readfilestr(sHTMLPath, null);
    }
    catch (com.enterprisedt.net.ftp.FTPException ftpe) {}

  if (null==sHtml) throw new FileNotFoundException(sHTMLPath);
  if (sHtml.length()==0) throw new FileNotFoundException(sHTMLPath);

    PatternMatcher oMatcher = new Perl5Matcher();
    PatternCompiler oCompiler = new Perl5Compiler();

    Parser parser = Parser.createParser(sHtml, null);
View Full Code Here

        // Create directory storage/jobs

        oRetObj.oLogFile = new File(sStorage);
        if (!oRetObj.oLogFile.exists()) oRetObj.oLogFile.mkdir();
        if (!oRetObj.oLogFile.exists()) throw new FileNotFoundException(sStorage);

        // Create directory storage/jobs/gu_workarea

        sStorage += System.getProperty("file.separator") + oRetObj.getString(DB.gu_workarea);
        oRetObj.oLogFile = new File(sStorage);
        if (!oRetObj.oLogFile.exists()) oRetObj.oLogFile.mkdir();
        if (!oRetObj.oLogFile.exists()) throw new FileNotFoundException(sStorage);

        // Create directory storage/jobs/gu_workarea/gu_job
        // oRetObj.oLogFile = new File(sStorage + System.getProperty("file.separator") + sJobId);
        // if (!oRetObj.oLogFile.exists()) oRetObj.oLogFile.mkdir();
        // if (!oRetObj.oLogFile.exists()) throw new FileNotFoundException(sStorage);
View Full Code Here

      try {
        oInputStream = new FileInputStream(sInputURI);
      } catch (FileNotFoundException fnf) {
        if (DebugFile.trace) DebugFile.decIdent();
        throw new FileNotFoundException(fnf.getMessage());
      }
    }

    oDecoder = com.sun.media.jai.codec.ImageCodec.createImageDecoder(getImageCodec(), oInputStream, null);
View Full Code Here

                }
                return FTP_ERROR;
             }
             if (previousReplyCode == 550)
             {
                throw new FileNotFoundException();
             }
       }
       return FTP_ERROR;
     }
View Full Code Here

    catch (Exception e)
    {
      s_log.error("getLocalReleaseFile: Exception encountered while " + "attempting to find "
        + RELEASE_XML_FILENAME + " file");
    }
    if (result == null) { throw new FileNotFoundException("File " + RELEASE_XML_FILENAME
      + " could not be found"); }
    return result;
  }
View Full Code Here

      {
        result = _serializer.readChannelBean(releaseXmlFile);
      }
      else
      {
        throw new FileNotFoundException("Current release file couldn't be downloaded");
      }
    }
    finally
    {
      _iou.closeInputStream(is);
View Full Code Here

    FileWrapper mockChangeListFile = helper.createMock("mockChangeListFile", FileWrapper.class);
    mockUpdateUtil.copyFile(mockChangeListFile, mockBackupRootDirFile);
    expect(mockUpdateUtil.deleteFile(mockChangeListFile)).andReturn(true);
    expect(mockUpdateUtil.getLocalReleaseFile()).andThrow(
      new FileNotFoundException("simulate local release doesn't exist"));

    mockUpdateUtil.copyFile(mockDownloadReleaseFile, mockUpdateRootDirFile);
    expectLastCall().andThrow(new IOException("simulate install new release file failed"));

    setupInstallEventsAndListener(1);
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.