Package java.io

Examples of java.io.FileNotFoundException.initCause()


            catch ( ResourceDoesNotExistException e )
            {
                String msg = "Resource " + name + " does not exist";
                logError( msg, e );
                FileNotFoundException fileNotFoundException = new FileNotFoundException( msg );
                fileNotFoundException.initCause( e );
                throw fileNotFoundException;
            }
            catch ( WagonException e )
            {
                String msg = "Transfer for " + name + " failed";
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

        catch(MalformedURLException e)
        {
            logger.error("malformed URL: " + e.getMessage(), e);
           
            FileNotFoundException fnfe = new FileNotFoundException("malformed URL");
            fnfe.initCause(e);
            throw fnfe;
        }
       
        return filenameURL.openStream();       
    }
View Full Code Here

        current = EMPTY_BUFFER;
        next = null;
        pendingFetch = null;
      } else if (e.getCause() instanceof FileNotFoundException) {
        FileNotFoundException toThrow = new FileNotFoundException(e.getMessage());
        toThrow.initCause(e);
        throw toThrow;
      } else if (e.getCause() instanceof IOException) {
        log.log(Level.WARNING, this + ": IOException fetching block", e);
        requestBlock();
        throw new IOException(this + ": Prefetch failed, prefetching again", e.getCause());
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 (IOException ioe) {
                // Other IOExceptions should be wrapped, since
                // FileNotFoundException is the only one we are allowed
                // to throw here.
                FileNotFoundException e = new FileNotFoundException();
                e.initCause(ioe);
                throw e;
            }
        }

        return result;
View Full Code Here

    if (response != null) {
      int status = response.getStatus();
      if (status >= 400 && status < 500) {
        FileNotFoundException fnfe =
            new FileNotFoundException(targetURL);
        fnfe.initCause(exception);
        return fnfe;
      }
    }

    return new IOException("Failed to GET " + targetURL + ": " + exception, exception);
View Full Code Here

      return ErasureUtils.uncheckedCast(CMMClassifier.getClassifier(path));
    } catch (Exception e) {
      //fail
      //System.err.println("Couldn't load classifier from path :"+path);
      FileNotFoundException fnfe = new FileNotFoundException();
      fnfe.initCause(e);
      throw fnfe;
    }
  }

  @Override
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

      // 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

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.