Package org.apache.geronimo.datastore.impl

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


    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

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.