public static String readTxn(File activityFile) { String txnName = null; for (int i = 0; i < 10; i++) { try { txnName = SVNFileUtil.readSingleLine(activityFile); } catch (IOException e) { //ignore } } return txnName; }
public static boolean createSymlink(File link, File linkName) throws SVNException { if (isWindows) { return false; } if (SVNFileType.getType(link) != SVNFileType.NONE) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Cannot create symbolic link ''{0}''; file already exists", link); SVNErrorManager.error(err); } String linkTarget = ""; try { linkTarget = readSingleLine(linkName); } catch (IOException e) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e.getLocalizedMessage()); SVNErrorManager.error(err, e); } if (linkTarget.startsWith("link")) { linkTarget = linkTarget.substring("link".length()).trim(); } return createSymlink(link, linkTarget); }
public static boolean createSymlink(File link, File linkName) throws SVNException { if (!symlinksSupported()) { return false; } if (SVNFileType.getType(link) != SVNFileType.NONE) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Cannot create symbolic link ''{0}''; file already exists", link); SVNErrorManager.error(err, Level.FINE, SVNLogType.WC); } String fileContents = ""; try { fileContents = readSingleLine(linkName); } catch (IOException e) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e.getMessage()); SVNErrorManager.error(err, e, Level.FINE, SVNLogType.DEFAULT); } if (fileContents.startsWith("link ")) { fileContents = fileContents.substring("link".length()).trim(); return createSymlink(link, fileContents); } //create file using internal representation createFile(link, fileContents, "UTF-8"); return true; }
public static boolean createSymlink(File link, File linkName) throws SVNException { if (!symlinksSupported()) { return false; } if (SVNFileType.getType(link) != SVNFileType.NONE) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Cannot create symbolic link ''{0}''; file already exists", link); SVNErrorManager.error(err, Level.FINE, SVNLogType.WC); } String fileContents = ""; try { fileContents = readSingleLine(linkName); } catch (IOException e) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e.getMessage()); SVNErrorManager.error(err, e, Level.FINE, SVNLogType.DEFAULT); } if (fileContents.startsWith("link ")) { fileContents = fileContents.substring("link".length()).trim(); return createSymlink(link, fileContents); } //create file using internal representation createFile(link, fileContents, "UTF-8"); return true; }
public static boolean createSymlink(File link, File linkName) throws SVNException { if (!symlinksSupported()) { return false; } if (SVNFileType.getType(link) != SVNFileType.NONE) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Cannot create symbolic link ''{0}''; file already exists", link); SVNErrorManager.error(err, Level.FINE, SVNLogType.WC); } String fileContents = ""; try { fileContents = readSingleLine(linkName); } catch (IOException e) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e.getMessage()); SVNErrorManager.error(err, e, Level.FINE, SVNLogType.DEFAULT); } if (fileContents.startsWith("link ")) { fileContents = fileContents.substring("link".length()).trim(); return createSymlink(link, fileContents); } // create file using internal representation createFile(link, fileContents, "UTF-8"); return true; }