private static boolean isRepositoryRoot(File candidatePath) { File formatFile = new File(candidatePath, REPOS_FORMAT_FILE); SVNFileType fileType = SVNFileType.getType(formatFile); if (fileType != SVNFileType.FILE) { return false; } File dbFile = new File(candidatePath, DB_DIR); fileType = SVNFileType.getType(dbFile); if (fileType != SVNFileType.DIRECTORY && fileType != SVNFileType.SYMLINK) { return false; } return true; }
public boolean isLocked(File path) throws SVNException { File lockFile = new File(path, SVNFileUtil.getAdminDirectoryName()); lockFile = new File(lockFile, "lock"); if (SVNFileType.getType(lockFile) == SVNFileType.FILE) { return true; } else if (SVNFileType.getType(lockFile) == SVNFileType.NONE) { return false; } SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.WC_LOCKED, "Lock file ''{0}'' is not a regular file", lockFile); SVNErrorManager.error(err, SVNLogType.WC); return false; }
public boolean isLocked(File path) throws SVNException { File lockFile = new File(path, SVNFileUtil.getAdminDirectoryName()); lockFile = new File(lockFile, "lock"); if (SVNFileType.getType(lockFile) == SVNFileType.FILE) { return true; } else if (SVNFileType.getType(lockFile) == SVNFileType.NONE) { return false; } SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.WC_LOCKED, "Lock file ''{0}'' is not a regular file", lockFile); SVNErrorManager.error(err); return false; }
public static long getFileLength(File file) { if (symlinksSupported()) { SVNFileType type = SVNFileType.getType(file); if (type == SVNFileType.SYMLINK) { try { return getSymlinkName(file).getBytes("UTF-8").length; } catch (UnsupportedEncodingException e) { return getSymlinkName(file).getBytes().length; } } } return file.length(); }
public void write(Object writeBaton, String s) throws SVNException { if (!s.startsWith("link ")) { SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.IO_WRITE_ERROR, "Invalid link representation"); SVNErrorManager.error(errorMessage, SVNLogType.WC); } s = s.substring("link ".length()); File targetAbsPath = (File) writeBaton; if (SVNFileType.getType(targetAbsPath) == SVNFileType.FILE) { SVNFileUtil.deleteFile(targetAbsPath); } SVNFileUtil.createSymlink(targetAbsPath, s); }
private RemoveArtifactInfo removeArtifactFileIfExists(File wriAbsPath, File artifactFileAbsPath) throws SVNException { RemoveArtifactInfo removeArtifactInfo = new RemoveArtifactInfo(); removeArtifactInfo.workItem = null; if (artifactFileAbsPath != null) { SVNNodeKind nodeKind = SVNFileType.getNodeKind(SVNFileType.getType(artifactFileAbsPath)); if (nodeKind == SVNNodeKind.FILE) { removeArtifactInfo.workItem = wqBuildFileRemove(wriAbsPath, artifactFileAbsPath); removeArtifactInfo.fileFound = true; } } return removeArtifactInfo; }
private SVNNodeKind getDiskKind(String path) { File file = getFile(path); SVNFileType type = null; type = SVNFileType.getType(file); if (type == SVNFileType.UNKNOWN) { return SVNNodeKind.UNKNOWN; } if (myIsDryRun && isPathDeleted(path)) { return SVNNodeKind.NONE; } return SVNFileType.getNodeKind(type); }
private SVNNodeKind getDiskKind(String path) { File file = getFile(path); SVNFileType type = null; type = SVNFileType.getType(file); if (type == SVNFileType.UNKNOWN) { return SVNNodeKind.UNKNOWN; } if (myIsDryRun && isPathDeleted(path)) { return SVNNodeKind.NONE; } return SVNFileType.getNodeKind(type); }
public static CheckSpecialInfo checkSpecialPath(File localAbspath) { CheckSpecialInfo info = new CheckSpecialInfo(); SVNFileType fileType = SVNFileType.getType(localAbspath); info.kind = SVNFileType.getNodeKind(fileType); info.isSpecial = !SVNFileUtil.symlinksSupported() ? false : fileType == SVNFileType.SYMLINK; return info; }
private SVNNodeKind getDiskKind(String path) { File file = getFile(path); SVNFileType type = null; type = SVNFileType.getType(file); if (type == SVNFileType.UNKNOWN) { return SVNNodeKind.UNKNOWN; } if (myIsDryRun && isPathDeleted(path)) { return SVNNodeKind.NONE; } return SVNFileType.getNodeKind(type); }
public boolean accept(File file) throws SVNException { final SVNFileType fileType = SVNFileType.getType(file); return filterCallback.filter(SVNFileUtil.getFilePath(file), getNodeKind(SVNFileType.getNodeKind(fileType)), fileType == SVNFileType.SYMLINK); } };
public boolean hasPropConflict(String name) throws SVNException { SVNEntry entry = getEntry(name, false); if (entry != null && entry.getPropRejectFile() != null) { return SVNFileType.getType(getFile(entry.getPropRejectFile())) == SVNFileType.FILE; } return false; }
public boolean hasPropConflict(String name) throws SVNException { SVNEntry entry = getEntry(name, false); if (entry != null && entry.getPropRejectFile() != null) { return SVNFileType.getType(getFile(entry.getPropRejectFile())) == SVNFileType.FILE; } return false; }
public boolean hasPropConflict(String name) throws SVNException { SVNEntry entry = getEntry(name, false); if (entry != null && entry.getPropRejectFile() != null) { return SVNFileType.getType(getFile(entry.getPropRejectFile())) == SVNFileType.FILE; } return false; }
public boolean hasPropConflict(String name) throws SVNException { SVNEntry entry = getEntry(name, false); if (entry != null && entry.getPropRejectFile() != null) { return SVNFileType.getType(getFile(entry.getPropRejectFile())) == SVNFileType.FILE; } return false; }
public static void copy(File src, File dst, boolean safe, boolean copyAdminDirectories) throws SVNException { SVNFileType srcType = SVNFileType.getType(src); if (srcType == SVNFileType.FILE) { copyFile(src, dst, safe); } else if (srcType == SVNFileType.DIRECTORY) { copyDirectory(src, dst, copyAdminDirectories, null); } else if (srcType == SVNFileType.SYMLINK) { String name = SVNFileUtil.getSymlinkName(src); if (name != null) { SVNFileUtil.createSymlink(dst, name); } } }
public static void doDeleteUnversionedFiles(SVNWCAccess wcAccess, File path, boolean deleteFiles) throws SVNException { wcAccess.checkCancelled(); SVNFileType fileType = SVNFileType.getType(path); if (fileType == SVNFileType.NONE) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_FILENAME, "''{0}'' does not exist", path); SVNErrorManager.error(err); } if (deleteFiles) { SVNFileUtil.deleteAll(path, true, wcAccess.getEventHandler()); } }
public FSTransactionInfo openTxn(String txnName) throws SVNException { SVNFileType kind = SVNFileType.getType(getTransactionDir(txnName)); if (kind != SVNFileType.DIRECTORY) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NO_SUCH_TRANSACTION, "No such transaction"); SVNErrorManager.error(err, SVNLogType.FSFS); } FSTransactionRoot txnRoot = new FSTransactionRoot(this, txnName, -1, 0); FSTransactionInfo localTxn = txnRoot.getTxn(); return new FSTransactionInfo(localTxn.getBaseRevision(), txnName); }
public FSTransactionInfo openTxn(String txnName) throws SVNException { SVNFileType kind = SVNFileType.getType(getTransactionDir(txnName)); if (kind != SVNFileType.DIRECTORY) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NO_SUCH_TRANSACTION, "No such transaction"); SVNErrorManager.error(err, SVNLogType.FSFS); } FSTransactionRoot txnRoot = new FSTransactionRoot(this, txnName, -1, 0); FSTransactionInfo localTxn = txnRoot.getTxn(); return new FSTransactionInfo(localTxn.getBaseRevision(), txnName); }
public FSTransactionInfo openTxn(String txnName) throws SVNException { SVNFileType kind = SVNFileType.getType(getTransactionDir(txnName)); if (kind != SVNFileType.DIRECTORY) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NO_SUCH_TRANSACTION, "No such transaction"); SVNErrorManager.error(err, SVNLogType.FSFS); } FSTransactionRoot txnRoot = new FSTransactionRoot(this, txnName, -1, 0); FSTransactionInfo localTxn = txnRoot.getTxn(); return new FSTransactionInfo(localTxn.getBaseRevision(), txnName); }