Package java.io

Examples of java.io.FileNotFoundException


    synchronized (classReaderCache) {
      ClassReader classReader = (ClassReader) classReaderCache.get(clazz);
      if (classReader == null) {
        InputStream is = clazz.getResourceAsStream(getClassFileName(clazz));
        if (is == null)
          throw new FileNotFoundException("Class file for class [" + clazz.getName() + "] not found");
        try {
          classReader = new ClassReader(is);
          classReaderCache.put(clazz, classReader);
        } finally {
          is.close();
View Full Code Here


      indexClass = Class.forName( properties.getString( Index.PropertyKeys.INDEXCLASS, "(missing index class)" ));
    }
    catch( Exception ignore ) {}

    File indexFile = new File( basename + INDEX_EXTENSION );
    if ( ! indexFile.exists() ) throw new FileNotFoundException( "Cannot find index file " + indexFile.getName() );
   
    final Map<Component,Coding> flags = CompressionFlags.valueOf( properties.getStringArray( Index.PropertyKeys.CODING ), null );

    final int numberOfDocuments = properties.getInt( Index.PropertyKeys.DOCUMENTS );
    final int numberOfTerms = properties.getInt( Index.PropertyKeys.TERMS );
View Full Code Here

                InputStream in = getClass().getResourceAsStream(fileName);
                if (in == null) {
                    Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName);
                }
                if (in == null) {
                    throw new FileNotFoundException("resource " + fileName);
                }
                return in;
            }
            // otherwise an URL is assumed
            URL url = new URL(fileName);
View Full Code Here

      final ByteOrder order, Filter<ProtocolFilterTarget> filter)
      throws FileNotFoundException, IOException, FileFormatException {

    // Create empty file?
    if (file.createNewFile() == false) {
      throw new FileNotFoundException("Unable to create new file ["
          + file.getName() + "]");
    }

    PcapFile capture = new PcapFileCapture(FileMode.ReadWrite, filter);
    final FileEditor editor = new FileEditorImpl(file, FileMode.ReadWrite,
View Full Code Here

  private void openFile(final File file,
      Filter<ProtocolFilterTarget> protocolFilter) throws IOException,
      FileFormatException {

    if (file.canRead() == false) {
      throw new FileNotFoundException("File [" + file.getName()
          + "] is not readable, can not open in [" + this.mode.toString()
          + "]mode");
    }

    if (this.mode.isAppend() || this.mode.isContent()
        || this.mode.isStructure()) {
      if (file.canWrite() == false) {
        throw new FileNotFoundException("File [" + file.getName()
            + "] is readonly, can not open in read-write mode");
      }
    }

    this.editor = new FileEditorImpl(file, this.mode, headerReader,
View Full Code Here

      }
    }

    if (dst.createNewFile() == false) {
      throw new FileNotFoundException("Unable to create dst file ["
          + dst.getName() + "]");
    }

    final FileChannel srcC = new RandomAccessFile(src, "r").getChannel();
View Full Code Here

          sourceFile.getPath()
        };
      Main.compile(args);
      classFile = new File(tempdir, classFilename);
      if (!classFile.exists()) {
        throw new FileNotFoundException("ClassFile "+ classFile + " seems not to have been created");
      }
      in = new FileInputStream(classFile);
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      byte[] buffer= new byte[bufferSize];
      int count;
View Full Code Here

    private File getTarget(String extension) throws FileNotFoundException {
        File target = fileField.getFile();
       
        if (target == null)
            throw new FileNotFoundException();
       
        String filename = target.toString();
        if (!filename.toLowerCase().endsWith(extension.toLowerCase())) {
           
            if (filename.lastIndexOf(".") > 0)
View Full Code Here

    }


    // Create empty file?
    if (file.createNewFile() == false) {
      throw new FileNotFoundException("Unable to create new file ["
          + file.getName() + "]");
    }

    SnoopFile capture = new SnoopFileCapture(FileMode.ReadWrite);
View Full Code Here

  private void openFile(final File file, Filter<ProtocolFilterTarget> filter)
      throws IOException, FileFormatException {

    if (file.canRead() == false) {
      throw new FileNotFoundException("File [" + file.getName()
          + "] is not readable, can not open in [" + mode.toString() + "]mode");
    }

    if (mode.isAppend() || mode.isContent() || mode.isStructure()) {
      if (file.canWrite() == false) {
        throw new FileNotFoundException("File [" + file.getName()
            + "] is readonly, can not open in read-write mode");
      }
    }

    this.editor = new FileEditorImpl(file, this.mode, headerReader,
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.