Example usage for org.apache.commons.vfs FileSystemException printStackTrace

List of usage examples for org.apache.commons.vfs FileSystemException printStackTrace

Introduction

In this page you can find the example usage for org.apache.commons.vfs FileSystemException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:com.thinkberg.moxo.dav.MoveHandler.java

protected void copyOrMove(FileObject object, FileObject target, int depth) throws FileSystemException {
    try {/*from  w ww  .  j  av a 2  s .co m*/
        object.moveTo(target);
    } catch (FileSystemException ex) {
        ex.printStackTrace();
        target.copyFrom(object, new DepthFileSelector(depth));
        object.delete(new DepthFileSelector());
    }
}

From source file:com.panet.imeta.core.vfs.KettleVFS.java

private KettleVFS() {
    // Install a shutdown hook to make sure that the file system manager is closed
    // This will clean up temporary files in vfs_cache
    ////from   w  w  w .j a  v a 2  s.c  o  m
    Thread thread = new Thread(new Runnable() {
        public void run() {
            try {
                FileSystemManager mgr = VFS.getManager();
                if (mgr instanceof DefaultFileSystemManager) {
                    ((DefaultFileSystemManager) mgr).close();
                }
            } catch (FileSystemException e) {
                e.printStackTrace();
            }
        }
    });
    Runtime.getRuntime().addShutdownHook(thread);
}

From source file:com.thinkberg.moxo.dav.data.DavResource.java

@SuppressWarnings({ "WeakerAccess" })
protected boolean addGetContentLengthProperty(Element root) {
    try {//w w w .  j  av  a 2s . c o m
        Element el = root.addElement(PROP_GET_CONTENT_LENGTH);
        if (!ignoreValues) {
            el.addText("" + object.getContent().getSize());
        }
        return true;
    } catch (FileSystemException e) {
        e.printStackTrace();
        return false;
    }
}

From source file:com.thinkberg.moxo.dav.data.DavResource.java

@SuppressWarnings({ "WeakerAccess" })
protected boolean addGetLastModifiedProperty(Element root) {
    try {//from   ww  w . j  a  va  2  s.c  o  m
        Element el = root.addElement(PROP_GET_LAST_MODIFIED);
        if (!ignoreValues) {
            el.addText(Util.getDateString(object.getContent().getLastModifiedTime()));
        }
        return true;
    } catch (FileSystemException e) {
        e.printStackTrace();
        return false;
    }
}

From source file:com.thinkberg.moxo.dav.data.DavResource.java

@SuppressWarnings({ "WeakerAccess" })
protected boolean addGetContentTypeProperty(Element root) {
    try {/*from   w  w  w  . j  ava  2s .co  m*/
        String contentType = object.getContent().getContentInfo().getContentType();
        if (null == contentType || "".equals(contentType)) {
            return false;
        }

        Element el = root.addElement(PROP_GET_CONTENT_TYPE);
        if (!ignoreValues) {
            el.addText(contentType);
        }
        return true;
    } catch (FileSystemException e) {
        e.printStackTrace();
        return false;
    }
}

From source file:com.thinkberg.webdav.data.DavResource.java

protected boolean addGetContentLengthProperty(Element root, boolean ignoreValue) {
    try {/*from   w  ww .  ja  v a  2  s.  com*/
        Element el = root.addElement(PROP_GET_CONTENT_LENGTH);
        if (!ignoreValue) {
            el.addText("" + object.getContent().getSize());
        }
        return true;
    } catch (FileSystemException e) {
        e.printStackTrace();
        return false;
    }
}

From source file:com.thinkberg.webdav.data.DavResource.java

protected boolean addGetLastModifiedProperty(Element root, boolean ignoreValue) {
    try {/*from   w ww  .  j a  v  a2s .c  om*/
        Element el = root.addElement(PROP_GET_LAST_MODIFIED);
        if (!ignoreValue) {
            el.addText(Util.getDateString(object.getContent().getLastModifiedTime()));
        }
        return true;
    } catch (FileSystemException e) {
        e.printStackTrace();
        return false;
    }
}

From source file:com.thinkberg.moxo.dav.data.DavResource.java

@SuppressWarnings({ "WeakerAccess" })
protected boolean addLockDiscoveryProperty(Element root) {
    Element lockdiscoveryEl = root.addElement(PROP_LOCK_DISCOVERY);
    try {// w w w . ja  v  a 2s  . co  m
        List<Lock> locks = LockManager.getInstance().discoverLock(object);
        if (locks != null && !locks.isEmpty()) {
            for (Lock lock : locks) {
                if (lock != null && !ignoreValues) {
                    lock.serializeToXml(lockdiscoveryEl);
                }
            }
        }
        return true;
    } catch (FileSystemException e) {
        e.printStackTrace();
        root.remove(lockdiscoveryEl);
        return false;
    }
}

From source file:com.thinkberg.webdav.data.DavResource.java

protected boolean addGetContentTypeProperty(Element root, boolean ignoreValue) {
    try {//from  w w  w  .  ja  va2s. c o  m
        String contentType = object.getContent().getContentInfo().getContentType();
        if (null == contentType || "".equals(contentType)) {
            return false;
        }

        Element el = root.addElement(PROP_GET_CONTENT_TYPE);
        if (!ignoreValue) {
            el.addText(contentType);
        }
        return true;
    } catch (FileSystemException e) {
        e.printStackTrace();
        return false;
    }
}

From source file:com.thinkberg.webdav.data.DavResource.java

protected boolean addLockDiscoveryProperty(Element root, boolean ignoreValue) {
    Element lockdiscoveryEl = root.addElement(PROP_LOCK_DISCOVERY);
    try {/*  w  w  w  . j av a  2 s  .  co m*/
        List<Lock> locks = LockManager.getInstance().discoverLock(object);
        if (locks != null && !locks.isEmpty()) {
            for (Lock lock : locks) {
                if (lock != null && !ignoreValue) {
                    lock.serializeToXml(lockdiscoveryEl);
                }
            }
        }
        return true;
    } catch (FileSystemException e) {
        root.remove(lockdiscoveryEl);
        e.printStackTrace();
        return false;
    }
}