/** * Makes a copy of this file. * * @return a clone of the current file (as a replica) or <tt>null</tt> if an error occurs */ private File makeCopy() { File file = null; try { file = new File(name, attribute.getFileSize()); FileAttribute fileAttr = file.getFileAttribute(); attribute.copyValue(fileAttr); fileAttr.setMasterCopy(false); // set this file to replica } catch (Exception e) { file = null; } return file; }