Package java.io

Examples of java.io.FileNotFoundException.initCause()


     */
    @Test
    public void testFormatChainedMessages() {
        final String lineSeparator = JDK7.lineSeparator();
        final FileNotFoundException cause = new FileNotFoundException("MisingFile.txt");
        cause.initCause(new Exception("Disk is not mounted."));
        final Exception e = new Exception("Can not find “MisingFile.txt”.", cause);
        /*
         * The actual sequence of messages (with their cause is):
         *
         *    Can not find “MisingFile.txt”
View Full Code Here


                throw new IOException( e.getMessage(), e );
            }
            catch ( ResourceDoesNotExistException e )
            {
                FileNotFoundException fnfe = new FileNotFoundException( e.getMessage() );
                fnfe.initCause( e );
                throw fnfe;
            }
        }

        // FIXME remove crappy copy/paste
View Full Code Here

        catch( FileNotFoundException e )
        {
            final FileNotFoundException fnfe
                = new FileNotFoundException( file.getAbsolutePath() );
           
            fnfe.initCause( e );
           
            throw fnfe;
        }
    }
View Full Code Here

      // and attempt to recover by getting the object from another
      // source.
      //
      final FileNotFoundException e;
      e = new FileNotFoundException(id.name());
      e.initCause(parsingError);
      throw e;
    }

    final int type = uol.getType();
    final byte[] raw = uol.getCachedBytes();
View Full Code Here

      // and attempt to recover by getting the object from another
      // source.
      //
      final FileNotFoundException e;
      e = new FileNotFoundException(id.name());
      e.initCause(parsingError);
      throw e;
    }

    final int type = uol.getType();
    final byte[] raw = uol.getCachedBytes();
View Full Code Here

      }
      catch (MalformedURLException e)
      {
         System.err.println("locateURL: URL creation problem");
         FileNotFoundException exception = new FileNotFoundException("locateURL: URL creation problem");
         exception.initCause(e);
         throw exception;
      }
      if ((url = locateByResource(findFile)) != null)
         return url;
View Full Code Here

      // and attempt to recover by getting the object from another
      // source.
      //
      final FileNotFoundException e;
      e = new FileNotFoundException(id.name());
      e.initCause(parsingError);
      throw e;
    }

    final int type = uol.getType();
    final byte[] raw = uol.getCachedBytes();
View Full Code Here

         return new ByteArrayInputStream(baos.toByteArray());
      }
      catch (IOException ex)
      {
         FileNotFoundException e = new FileNotFoundException("Failed to recompose inflated nested archive " + getName());
         e.initCause(ex);
         throw e;
      }
   }

   /**
 
View Full Code Here

        // Ignore any error closing the stream.
      }

      final FileNotFoundException r;
      r = new FileNotFoundException(MessageFormat.format(HttpServerText.get().cannotGetLengthOf, path));
      r.initCause(e);
      throw r;
    }
  }

  void close() {
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.