private void createPhysicalLock(File absPath) throws SVNException { File lockAbsPath = buildLockfilePath(absPath); if (lockAbsPath.isFile()) { /* Congratulations, we just stole a physical lock from somebody */ return; } SVNFileUtil.createEmptyFile(lockAbsPath); }
do { if (SVNFileType.getType(file) == SVNFileType.NONE) { createEmptyFile(file); return file;
do { if (SVNFileType.getType(file) == SVNFileType.NONE) { createEmptyFile(file); return file;
public synchronized void lock() throws SVNException { boolean errorOccured = false; Exception childError = null; if (myLock != null) { errorOccured = true; } try { SVNFileType type = SVNFileType.getType(myLockFile); if (type == SVNFileType.UNKNOWN || type == SVNFileType.NONE) { SVNFileUtil.createEmptyFile(myLockFile); } myLockRAFile = new RandomAccessFile(myLockFile, "rw"); myLock = myLockRAFile.getChannel().lock(0L, Long.MAX_VALUE, myIsShared); } catch (IOException ioe) { unlock(); errorOccured = true; childError = ioe; } if (errorOccured) { String msg = childError == null ? "file already locked" : childError.getMessage(); SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Can''t get exclusive lock on file ''{0}'': {1}", new Object[]{ myLockFile, msg }); SVNErrorManager.error(err, childError, SVNLogType.FSFS); } }
SVNFileUtil.createEmptyFile(targetFile);
public synchronized void lock() throws SVNException { File writeLockFile = myFSFS.getWriteLockFile(); try { SVNFileType type = SVNFileType.getType(writeLockFile); if (type == SVNFileType.UNKNOWN || type == SVNFileType.NONE) { SVNFileUtil.createEmptyFile(writeLockFile); } myLockFile = new RandomAccessFile(writeLockFile, "rw"); myLock = myLockFile.getChannel().lock(); } catch (IOException ioe) { unlock(); SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Can't get exclusive lock on file ''{0}'': {1}", new Object[] { writeLockFile, ioe.getLocalizedMessage() }); SVNErrorManager.error(err, ioe); } }
public void addFile(String path, String copyFromPath, long copyFromRevision) throws SVNException { myCurrentFile = new SVNFileInfo(path, true); myCurrentFile.myBaseProperties = Collections.EMPTY_MAP; myCurrentFile.myBaseFile = SVNFileUtil.createUniqueFile(getTempDirectory(), "diff", ".tmp"); SVNFileUtil.createEmptyFile(myCurrentFile.myBaseFile); }
public synchronized void lock() throws SVNException { boolean errorOccured = false; Exception childError = null; if (myLock != null) { errorOccured = true; } try { SVNFileType type = SVNFileType.getType(myLockFile); if (type == SVNFileType.UNKNOWN || type == SVNFileType.NONE) { SVNFileUtil.createEmptyFile(myLockFile); } myLockRAFile = new RandomAccessFile(myLockFile, "rw"); myLock = myLockRAFile.getChannel().lock(0L, Long.MAX_VALUE, myIsShared); } catch (IOException ioe) { unlock(); errorOccured = true; childError = ioe; } if (errorOccured) { String msg = childError == null ? "file already locked" : childError.getMessage(); SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Can''t get exclusive lock on file ''{0}'': {1}", new Object[]{ myLockFile, msg }); SVNErrorManager.error(err, childError, SVNLogType.FSFS); } }
SVNFileUtil.createEmptyFile(targetFile);
SVNFileUtil.createEmptyFile(targetFile);
createEmptyFile(file); if (contents == null || contents.length() == 0) { return;
private static FSTransactionInfo createTxn(long baseRevision, FSFS owner) throws SVNException { String txnID = createTxnDir(baseRevision, owner); FSTransactionInfo txn = new FSTransactionInfo(baseRevision, txnID); FSRevisionRoot root = owner.createRevisionRoot(baseRevision); FSRevisionNode rootNode = root.getRootRevisionNode(); owner.createNewTxnNodeRevisionFromRevision(txnID, rootNode); SVNFileUtil.createEmptyFile(new File(owner.getTransactionDir(txn.getTxnId()), FSFS.TXN_PATH_REV)); SVNFileUtil.createEmptyFile(new File(owner.getTransactionDir(txn.getTxnId()), "changes")); owner.writeNextIDs(txnID, "0", "0"); return txn; }
private static FSTransactionInfo createTxn(long baseRevision, FSFS owner) throws SVNException { String txnId = null; if (owner.getDBFormat() >= FSFS.MIN_CURRENT_TXN_FORMAT) { txnId = createTxnDir(baseRevision, owner); } else { txnId = createPre15TxnDir(baseRevision, owner); } FSTransactionInfo txn = new FSTransactionInfo(baseRevision, txnId); FSRevisionRoot root = owner.createRevisionRoot(baseRevision); FSRevisionNode rootNode = root.getRootRevisionNode(); owner.createNewTxnNodeRevisionFromRevision(txnId, rootNode); SVNFileUtil.createEmptyFile(owner.getTransactionProtoRevFile(txn.getTxnId())); SVNFileUtil.createEmptyFile(owner.getTransactionProtoRevLockFile(txn.getTxnId())); SVNFileUtil.createEmptyFile(new File(owner.getTransactionDir(txn.getTxnId()), "changes")); owner.writeNextIDs(txnId, "0", "0"); return txn; }
private static FSTransactionInfo createTxn(long baseRevision, FSFS owner) throws SVNException { String txnId = null; if (owner.getDBFormat() >= FSFS.MIN_CURRENT_TXN_FORMAT) { txnId = createTxnDir(baseRevision, owner); } else { txnId = createPre15TxnDir(baseRevision, owner); } FSTransactionInfo txn = new FSTransactionInfo(baseRevision, txnId); FSRevisionRoot root = owner.createRevisionRoot(baseRevision); FSRevisionNode rootNode = root.getRootRevisionNode(); owner.createNewTxnNodeRevisionFromRevision(txnId, rootNode); SVNFileUtil.createEmptyFile(owner.getTransactionProtoRevFile(txn.getTxnId())); SVNFileUtil.createEmptyFile(owner.getTransactionProtoRevLockFile(txn.getTxnId())); SVNFileUtil.createEmptyFile(new File(owner.getTransactionDir(txn.getTxnId()), "changes")); owner.writeNextIDs(txnId, "0", "0"); return txn; }
private static FSTransactionInfo createTxn(long baseRevision, FSFS owner) throws SVNException { String txnId = null; if (owner.getDBFormat() >= FSFS.MIN_CURRENT_TXN_FORMAT) { txnId = createTxnDir(baseRevision, owner); } else { txnId = createPre15TxnDir(baseRevision, owner); } FSTransactionInfo txn = new FSTransactionInfo(baseRevision, txnId); FSRevisionRoot root = owner.createRevisionRoot(baseRevision); FSRevisionNode rootNode = root.getRootRevisionNode(); owner.createNewTxnNodeRevisionFromRevision(txnId, rootNode); SVNFileUtil.createEmptyFile(owner.getTransactionProtoRevFile(txn.getTxnId())); SVNFileUtil.createEmptyFile(owner.getTransactionProtoRevLockFile(txn.getTxnId())); SVNFileUtil.createEmptyFile(new File(owner.getTransactionDir(txn.getTxnId()), "changes")); owner.writeNextIDs(txnId, "0", "0"); return txn; }
public synchronized void lock() throws SVNException { boolean errorOccured = false; Exception childError = null; if (myLock != null) { errorOccured = true; } try { SVNFileType type = SVNFileType.getType(myLockFile); if (type == SVNFileType.UNKNOWN || type == SVNFileType.NONE) { SVNFileUtil.createEmptyFile(myLockFile); } myLock = SVNDoubleLock.obtain(myLockFile, !myIsShared); } catch (SVNException ioe) { unlock(); errorOccured = true; childError = ioe; } if (errorOccured) { String msg = childError == null ? "file already locked" : childError.getMessage(); SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "Can''t get exclusive lock on file ''{0}'': {1}", new Object[]{ myLockFile, msg }); SVNErrorManager.error(err, childError, SVNLogType.FSFS); } }
private File loadFile(SVNURL url, File path, SVNRevision revision, Map properties, SVNAdminAreaInfo info, long[] revNumber) throws SVNException { String name = info.getTargetName(); File tmpDir = info.getAnchor().getRoot(); File result = SVNFileUtil.createUniqueFile(tmpDir, name, ".tmp"); SVNFileUtil.createEmptyFile(result); SVNRepository repository = createRepository(url, true); long revisionNumber = getRevisionNumber(revision, repository, path); OutputStream os = null; try { os = SVNFileUtil.openFileForWriting(result); repository.getFile("", revisionNumber, properties, new SVNCancellableOutputStream(os, this)); } finally { SVNFileUtil.closeFile(os); } if (revNumber != null && revNumber.length > 0) { revNumber[0] = revisionNumber; } return result; }
File txnCurrentFile = getTransactionCurrentFile(); SVNFileUtil.createFile(txnCurrentFile, "0\n", "US-ASCII"); SVNFileUtil.createEmptyFile(getTransactionCurrentLockFile());
File txnCurrentFile = getTransactionCurrentFile(); SVNFileUtil.createFile(txnCurrentFile, "0\n", "US-ASCII"); SVNFileUtil.createEmptyFile(getTransactionCurrentLockFile());
File txnCurrentFile = getTransactionCurrentFile(); SVNFileUtil.createFile(txnCurrentFile, "0\n", "US-ASCII"); SVNFileUtil.createEmptyFile(getTransactionCurrentLockFile());