Package org.apache.excalibur.source

Examples of org.apache.excalibur.source.SourceException


            }
            else
            {
                final String message =
                    "Failure during delete";
                throw new SourceException( message, e );
            }
        }
        finally
        {
            if ( ftpClient != null )
View Full Code Here


        {
            SourceUtil.copy(this.getInputStream(), ((ModifiableSource) destination).getOutputStream());
        }
        catch (IOException ioe)
        {
            throw new SourceException("Couldn't copy " + getURI() + " to " + destination.getURI(), ioe);
        }
    }
View Full Code Here

                parent.mkdirs(); // ensure parent directories exist
            }

            if (!m_file.renameTo(dest))
            {
                throw new SourceException("Couldn't move " + getURI() + " to " + destination.getURI());
            }
        }
        else
        {
            SourceUtil.move(this, destination);
View Full Code Here

            uri = file.toURL().toExternalForm();
        }
        catch (MalformedURLException mue)
        {
            // Can this really happen ?
            throw new SourceException("Failed to get URL for file " + file, mue);
        }

        if (!uri.startsWith(scheme))
        {
            // Scheme is not "file:"
View Full Code Here

     */
    public Source getChild(String name) throws SourceException
    {
        if (!m_file.isDirectory())
        {
            throw new SourceException(getURI() + " is not a directory");
        }

        return new FileSource(this.getScheme(), new File(m_file, name));

    }
View Full Code Here

    public Collection getChildren() throws SourceException
    {

        if (!m_file.isDirectory())
        {
            throw new SourceException(getURI() + " is not a directory");
        }

        // Build a FileSource object for each of the children
        File[] files = m_file.listFiles();
View Full Code Here

                {
                    fsos.cancel();
                }
                catch (Exception e)
                {
                    throw new SourceException("Exception during cancel.", e);
                }
                return;
            }
        }
View Full Code Here

            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

            return new ByteArrayInputStream(os.toByteArray());

        } catch (ResourceNotFoundException e) {
            throw new SourceNotFoundException("Exception during processing of " + this.systemId, e);
        } catch (Exception e) {
            throw new SourceException("Exception during processing of " + this.systemId, e);
        } finally {
            // Unhide wrapped environment output stream
            this.environment.setOutputStream(null);
            reset();
        }
View Full Code Here

        // Lookup resolver if needed
        if (this.resolver == null) {
            try {
                this.resolver = (SourceResolver)this.manager.lookup( SourceResolver.ROLE );
            } catch (ComponentException ce) {
              throw new SourceException("Unable to lookup source resolver.", ce);
            }
        }
               
        // Remove the protocol and the first '/'
        int pos = location.indexOf(":/");
View Full Code Here

TOP

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

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.