List of usage examples for org.apache.commons.transaction.file ResourceManagerException printStackTrace
public void printStackTrace()
From source file:org.jboss.jbossts.fileio.xalib.txdirs.dir.XADirFile.java
/** * Renames this file to the name of the file given by <code>file</code>. * * @param file the <codeFile</code> object that contains the new file name * @return true if the rename operations completed successfully;false otherwise * */// w w w . ja v a 2 s .c o m public synchronized boolean renameTo(File file) { String resId = "/" + file.getName(); try { freMngr.lockResource(curObjId, curTxId, false, false, 0, true); freMngr.copyResource(curTxId, curObjId, resId, true); freMngr.deleteResource(curTxId, curObjId); curObjId = resId; filename = file.getName(); return true; } catch (ResourceManagerException e) { e.printStackTrace(); } return false; }
From source file:org.jboss.jbossts.fileio.xalib.txdirs.dir.XADirFile.java
/** * Create a new file in the disk. If the file already exists the method * will return false; otherwise true.//from w w w.j a va2 s .c o m * * @return true if the file was created successfully; false otherwise */ public boolean createNewFile() { try { freMngr.createResource(curTxId, curObjId, false); xadir.increaseLength(); return true; } catch (ResourceManagerException e) { e.printStackTrace(); } return false; }
From source file:org.jboss.jbossts.fileio.xalib.txdirs.dir.XADirFile.java
/** * This method will delete the file. If the file does not * exist it will return false; Otherwise true. * * @return true if the file could be deleted successfully; * false otherwise./*www .j a v a 2s . com*/ */ public boolean delete() { try { freMngr.lockResource(curObjId, curTxId, false, false, 0, true); freMngr.deleteResource(curTxId, curObjId, false); xadir.decreaseLength(); return true; } catch (ResourceManagerException e) { e.printStackTrace(); } return false; }