Examples of XindiceException


Examples of org.apache.xindice.util.XindiceException

            }
            try {
                // In case home has been specified as relative path convert it to absolute path
                dbrootDir = new File(home, dbroot).getCanonicalFile();
            } catch (IOException e) {
                throw new XindiceException("Can't get canonical path", e);
            }
        }
        setCollectionRoot(dbrootDir);
        if (log.isInfoEnabled()) {
            log.info("Database points to " + dbrootDir.getAbsolutePath());
        }

        // Put a lock (at least attempt to) on the database
        // FIXME: Use JDK1.4 FileLock
        File lock = new File(getCollectionRoot(), "db.lock");
        try {
            if (lock.exists() && !lock.delete()) {
                throw new IOException("Could not delete lock file.");
            }
            this.lock = new FileOutputStream(lock);
            this.lock.write(new Date().toString().getBytes());
        } catch (IOException e) {
            throw new XindiceException("Unable to open lock file " + lock + ". " +
                                       "Make sure database is not open by another process. " +
                                       "Exception: " + e);
        }

        // Now we are ready to open it up
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.