Package org.apache.excalibur.source

Examples of org.apache.excalibur.source.SourceNotFoundException


                getLogger().debug("Executing statement " + select);
            }

            ResultSet rs = stmt.executeQuery(select);
            if (!rs.next()) {
                throw new SourceNotFoundException("Source not found.");
            }

            int colType = rs.getMetaData().getColumnType(1);
            switch(colType) {
                case Types.BLOB :
View Full Code Here


        }
        catch ( IOException e )
        {
            if ( e instanceof FileNotFoundException )
            {
                throw new SourceNotFoundException( e.getMessage() );
            }
            else
            {
                final String message =
                    "Failure during delete";
View Full Code Here

    public InputStream getInputStream()
        throws IOException, SourceException
    {
        if (!exists())
        {
            throw new SourceNotFoundException(getURI());
        }
       
        return m_location.openStream();
    }
View Full Code Here

        {
            return new FileInputStream(m_file);
        }
        catch (FileNotFoundException fnfe)
        {
            throw new SourceNotFoundException(m_uri + " doesn't exist.", fnfe);
        }
    }
View Full Code Here

     */
    public void delete() throws SourceException
    {
        if (!m_file.exists())
        {
            throw new SourceNotFoundException("Cannot delete non-existing file " + m_file.toString());
        }
       
        if (!m_file.delete())
        {
            throw new SourceException("Could not delete " + m_file.toString() + " (unknown reason)");
View Full Code Here

            error.append( m_uri );
            error.append( " (" );
            error.append( response );
            error.append( ")" );

            throw new SourceNotFoundException( error.toString() );
        }
       
        return method.getResponseBodyAsStream();
    }
View Full Code Here

     *
     * @see org.apache.excalibur.source.Source#getInputStream()
     */
    public InputStream getInputStream() throws IOException, SourceNotFoundException {
        if (this.node == null) {
            throw new SourceNotFoundException("Path '" + this.getURI() + "' does not exist");
        }

        if (this.isCollection()) {
            throw new SourceException("Path '" + this.getURI() + "' is a collection");
        }
View Full Code Here

                    }
                }
            }
       } catch (HttpException e) {
            if (e.getReasonCode() == HttpStatus.SC_NOT_FOUND) {
                throw new SourceNotFoundException("Not found: " + getSecureURI(), e);
            }
            final String msg = "Could not initialize webdav resource at " + getSecureURI()
                + ". Server responded " + e.getReasonCode() + " (" + e.getReason() + ") - " + e.getMessage();
            throw new SourceException(msg, e);
       } catch (IOException e) {
View Full Code Here

      if (!isSourceNotFoundException(e))
        throw e;
    }
   
    if (result == null)
      throw new SourceNotFoundException("Global profile does not exist.");
   
    // change references to objects where no delta has been applied
    result.adjustReferences(global);
   
        // FIXME
View Full Code Here

        ZipInputStream zipStream = new ZipInputStream(this.archive.getInputStream());
        try {
            ZipEntry entry = findEntry(zipStream);
            if (entry == null) {
                throw new SourceNotFoundException("File " + filePath + " is not found in the archive " +
                                                  this.archive.getURI());
            }

            // Now we will extract the document and write it into a byte array
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
View Full Code Here

TOP

Related Classes of org.apache.excalibur.source.SourceNotFoundException

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.