Package org.apache.geronimo.datastore.impl

Examples of org.apache.geronimo.datastore.impl.DAOException


    public void create(GFileTO aFileTO)
        throws DAOException {
        File target = new File(root, aFileTO.getPath());
       
        if ( target.exists() ) {
            throw new DAOException("{" + target.getAbsolutePath() +
                "} already exist. Can not write state.");
        }
       
        if ( GFile.NULL != aFileTO.getStream() ) {
            writeFileContent(aFileTO, target);
View Full Code Here


                int separator = line.indexOf('=');
                properties.put(line.substring(0, separator),
                    line.substring(separator + 1));
            }
        } catch (IOException e) {
            throw new DAOException(e);
        } finally {
            try {
                if ( null != reader ) { reader.close(); }
            } catch (IOException e) {}
        }
View Full Code Here

    public void delete(String aPath)
        throws DAOException {
        File target = new File(root, aPath);
       
        if ( !target.exists() ) {
            throw new DAOException("{" + target.getAbsolutePath() +
                "} does not exist. Can not delete.");
        }
        target.delete();
       
        File metadaFile = getMetaDataFile(target);
View Full Code Here

    public InputStream getInputStream(String aPath) throws DAOException {
        File target = new File(root, aPath);
        try {
            return new FileInputStream(target);
        } catch (FileNotFoundException e) {
            throw new DAOException(e);
        }
    }
View Full Code Here

        throws DAOException {
        File metadata = new File(aFile.getParentFile(),
            LocalGFileManager.META_DATA + File.separator + aFile.getName());
        if ( metadata.exists() ) {
           if ( metadata.isDirectory() ) {
               throw new DAOException("{" +
                   metadata.getAbsolutePath() + "} should be a file");
           }
        } else {
            boolean success;
            try {
                success = metadata.createNewFile();
            } catch (IOException e) {
                throw new DAOException(e);
            }
            if ( !success ) {
                throw new DAOException("Can not create file {" +
                    metadata.getAbsolutePath() + "}");
            }
        }
        return metadata;
    }
View Full Code Here

            int nbRead;
            while ( -1 < (nbRead = in2.read(buffer)) ) {
                out2.write(buffer, 0, nbRead);
            }
        } catch (IOException e) {
            throw new DAOException(e);
        } finally {
            try {
                if ( null != out2) { out2.close(); }
            } catch (IOException e) {}
        }
View Full Code Here

                    iter.hasNext();) {
                Map.Entry entry = (Map.Entry) iter.next();
                writer.println(entry.getKey() + "=" + entry.getValue());
            }
        } catch (IOException e) {
            throw new DAOException(e);
        } finally {
            if ( null != writer ) { writer.close(); }
        }
    }
View Full Code Here

    public void create(GFileTO aFileTO)
        throws DAOException {
        File target = new File(root, aFileTO.getPath());
       
        if ( target.exists() ) {
            throw new DAOException("{" + target.getAbsolutePath() +
                "} already exist. Can not write state.");
        }
       
        if ( GFile.NULL != aFileTO.getStream() ) {
            writeFileContent(aFileTO, target);
View Full Code Here

                int separator = line.indexOf('=');
                properties.put(line.substring(0, separator),
                    line.substring(separator + 1));
            }
        } catch (IOException e) {
            throw new DAOException(e);
        } finally {
            try {
                if ( null != reader ) { reader.close(); }
            } catch (IOException e) {}
        }
View Full Code Here

    public void delete(String aPath)
        throws DAOException {
        File target = new File(root, aPath);
       
        if ( !target.exists() ) {
            throw new DAOException("{" + target.getAbsolutePath() +
                "} does not exist. Can not delete.");
        }
        target.delete();
       
        File metadaFile = getMetaDataFile(target);
View Full Code Here

TOP

Related Classes of org.apache.geronimo.datastore.impl.DAOException

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.