Example #1
0
 public static void setProperties(
     SVNProperties namesToValues, File target, File tmpFile, String terminator)
     throws SVNException {
   OutputStream dst = null;
   try {
     if (tmpFile != null) {
       tmpFile.getParentFile().mkdirs();
     } else {
       target.getParentFile().mkdirs();
     }
     dst = SVNFileUtil.openFileForWriting(tmpFile != null ? tmpFile : target);
     setProperties(namesToValues, dst, terminator);
   } finally {
     SVNFileUtil.closeFile(dst);
   }
   if (tmpFile != null && target != null) {
     target.getParentFile().mkdirs();
     SVNFileUtil.rename(tmpFile, target);
   }
   if (target != null) {
     SVNFileUtil.setReadonly(target, true);
   }
 }