Package io.apigee.trireme.core.internal

Examples of io.apigee.trireme.core.internal.NodeOSException


        {
            FileHandle handle = ensureRegularFileHandle(fd);
            try {
                handle.file.getFD().sync();
            } catch (IOException ioe) {
                throw new NodeOSException(Constants.EIO, ioe);
            }
        }
View Full Code Here


        private void doRename(String oldPath, String newPath)
            throws NodeOSException
        {
            File oldFile = translatePath(oldPath);
            if (!oldFile.exists()) {
                NodeOSException ne = new NodeOSException(Constants.ENOENT);
                ne.setPath(oldPath);
                throw ne;
            }
            File newFile = translatePath(newPath);
            if ((newFile.getParentFile() != null) && !newFile.getParentFile().exists()) {
                NodeOSException ne = new NodeOSException(Constants.ENOENT);
                ne.setPath(newPath);
                throw ne;
            }
            if (!oldFile.renameTo(newFile)) {
                throw new NodeOSException(Constants.EIO);
            }
        }
View Full Code Here

        {
            try {
                FileHandle handle = ensureRegularFileHandle(fd);
                handle.file.setLength(len);
            } catch (IOException e) {
                throw new NodeOSException(Constants.EIO, e);
            }
        }
View Full Code Here

        private void doRmdir(String path)
            throws NodeOSException
        {
            File file = translatePath(path);
            if (!file.exists()) {
                NodeOSException ne = new NodeOSException(Constants.ENOENT);
                ne.setPath(path);
                throw ne;
            }
            if (!file.isDirectory()) {
                NodeOSException ne = new NodeOSException(Constants.ENOTDIR);
                ne.setPath(path);
                throw ne;
            }
            if (!file.delete()) {
                throw new NodeOSException(Constants.EIO);
            }
        }
View Full Code Here

        private void doUnlink(String path)
            throws NodeOSException
        {
            File file = translatePath(path);
            if (!file.exists()) {
                NodeOSException ne = new NodeOSException(Constants.ENOENT);
                ne.setPath(path);
                throw ne;
            }
            if (!file.delete()) {
                throw new NodeOSException(Constants.EIO);
            }
        }
View Full Code Here

        private void doMkdir(String path, int mode)
            throws NodeOSException
        {
            File file = translatePath(path);
            if (file.exists()) {
                throw new NodeOSException(Constants.EEXIST, path);
            }
            if (file.getParentFile() != null && !file.getParentFile().exists()) {
                throw new NodeOSException(Constants.ENOENT, path);
            }
            if (!file.mkdir()) {
                throw new NodeOSException(Constants.EIO, path);
            }
            setMode(file, mode);
        }
View Full Code Here

                File f = translatePath(fn);
                if (!f.exists()) {
                    if (log.isTraceEnabled()) {
                        log.trace("stat {} = {}", f.getPath(), Constants.ENOENT);
                    }
                    NodeOSException ne = new NodeOSException(Constants.ENOENT);
                    ne.setPath(fn);
                    throw ne;
                }
                StatsImpl s = (StatsImpl)cx.newObject(this, StatsImpl.CLASS_NAME);
                s.setAttributes(cx, f);
                if (log.isTraceEnabled()) {
View Full Code Here

            throws NodeOSException
        {
            // In Java 6, we can only set the modification time, not the access time
            // "mtime" comes from JavaScript as a decimal number of seconds
            if (!f.exists()) {
                NodeOSException ne = new NodeOSException(Constants.ENOENT);
                ne.setPath(f.getPath());
                throw ne;
            }
            f.setLastModified((long)(mtime * 1000.0));
            return new Object[] { Context.getUndefinedValue(), Context.getUndefinedValue() };
        }
View Full Code Here

                result = parser.parse(bBuf);
                if (result.isError()) {
                    if (log.isDebugEnabled()) {
                        log.debug("HTTP parser error");
                    }
                    throw new NodeOSException("HPE_INVALID_CONSTANT");
                }
                if (!sentCompleteHeaders) {
                    if (result.isHeadersComplete() || result.isComplete()) {
                        sentCompleteHeaders = true;
                        hadSomething = true;
View Full Code Here

TOP

Related Classes of io.apigee.trireme.core.internal.NodeOSException

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.