public void close() { if (myChannel != null) { try { myChannel.close(); } catch (IOException e) {} } SVNFileUtil.closeFile(myInputStream); myChannel = null; myInputStream = null; myPosition = 0; myDigest = null; }
public void close() { synchronized (result) { myIsEOF = true; result.notifyAll(); myIsClosed = true; SVNFileUtil.closeFile(is); } }
public void close() { if (myChannel != null) { try { myChannel.close(); } catch (IOException e) {} SVNFileUtil.closeFile(myInputStream); myChannel = null; myInputStream = null; myPosition = 0; myDigest = null; } }
public void close() { if (myChannel != null) { try { myChannel.close(); } catch (IOException e) {} SVNFileUtil.closeFile(myInputStream); myChannel = null; myInputStream = null; myPosition = 0; myDigest = null; } }
public void run() { try { int r; while ((r = is.read()) >= 0) { result.append((char) (r & 0xFF)); } } catch (IOException ioe) { error = ioe; } finally { SVNFileUtil.closeFile(is); } }
private static byte[] composePropertiesByteArray(SVNProperties properties) throws SVNException { final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); try { SVNWCProperties.setProperties(properties, byteArrayOutputStream, SVNWCProperties.SVN_HASH_TERMINATOR); return byteArrayOutputStream.toByteArray(); } finally { SVNFileUtil.closeFile(byteArrayOutputStream); } }
public byte[] asCompressedLevelNoneByteArray() throws SVNException { final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); OutputStream outputStream = byteArrayOutputStream; try { outputStream = writeCompressedLevelNone(byteArrayOutputStream); return byteArrayOutputStream.toByteArray(); } finally { SVNFileUtil.closeFile(outputStream); } }
public static void truncate(File file, long truncateToSize) throws IOException { RandomAccessFile raf = null; try { raf = openRAFileForWriting(file, false); raf.setLength(truncateToSize); } catch (SVNException e) { throw (IOException) new IOException(e.getMessage()).initCause(e); } finally { closeFile(raf); } }
public static void truncate(File file, long truncateToSize) throws IOException { RandomAccessFile raf = null; try { raf = openRAFileForWriting(file, false); raf.setLength(truncateToSize); } catch (SVNException e) { throw (IOException) new IOException(e.getMessage()).initCause(e); } finally { closeFile(raf); } }
public static void createFormatFile(File adminDir) throws SVNException { OutputStream os = null; try { os = SVNFileUtil.openFileForWriting(new File(adminDir, "format")); os.write(FORMAT_TEXT); } catch (IOException e) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e.getLocalizedMessage()); SVNErrorManager.error(err, e, SVNLogType.FSFS); } finally { SVNFileUtil.closeFile(os); } }
public static void createFormatFile(File adminDir) throws SVNException { OutputStream os = null; try { os = SVNFileUtil.openFileForWriting(new File(adminDir, "format")); os.write(FORMAT_TEXT); } catch (IOException e) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e.getLocalizedMessage()); SVNErrorManager.error(err, e, SVNLogType.FSFS); } finally { SVNFileUtil.closeFile(os); } }
private static void markLogProcessed(File logFile) throws SVNException { SVNFileUtil.setReadonly(logFile, false); OutputStream os = null; try { os = SVNFileUtil.openFileForWriting(logFile); } finally { if (os != null) { SVNFileUtil.closeFile(os); } } }
public void writeToFile(File packFile, boolean compress) throws SVNException { OutputStream outputStream = SVNFileUtil.openFileForWriting(packFile); try { if (compress) { outputStream = writeCompressedLevelDefault(outputStream); } else { outputStream = writeCompressedLevelNone(outputStream); } } finally { SVNFileUtil.closeFile(outputStream); } }
public void loadFromRepository() throws SVNException { myBaseFile = SVNFileUtil.createUniqueFile(getTempDirectory(), "diff", ".tmp"); OutputStream os = null; myBaseProperties = new HashMap(); try { os = SVNFileUtil.openFileForWriting(myBaseFile); myRepos.getFile(myRepositoryPath, myRevision1, myBaseProperties, new SVNCancellableOutputStream(os, myCancelHandler)); } finally { SVNFileUtil.closeFile(os); } }
private String computeSHA1Checksum(FSRoot revision, String filePath) throws SVNException { InputStream is = revision.getFileStreamForPath(getDeltaCombiner(), filePath); SVNChecksumInputStream checksum = null; try { checksum = new SVNChecksumInputStream(is, "SHA1"); } finally { SVNFileUtil.closeFile(checksum); } return checksum != null ? checksum.getDigest() : null; }
private String computeSHA1Checksum(FSRoot revision, String filePath) throws SVNException { InputStream is = revision.getFileStreamForPath(getDeltaCombiner(), filePath); SVNChecksumInputStream checksum = null; try { checksum = new SVNChecksumInputStream(is, "SHA1"); } finally { SVNFileUtil.closeFile(checksum); } return checksum != null ? checksum.getDigest() : null; }
public void fetchFileContent(OutputStream os) throws SVNException { InputStream is = SVNFileUtil.openFileForReading(path, SVNLogType.WC); try { SVNTranslator.copy(is, os); } catch (IOExceptionWrapper ioew) { throw ioew.getOriginalException(); } catch (IOException e) { SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.IO_ERROR), e, SVNLogType.DEFAULT); } finally { SVNFileUtil.closeFile(is); } }
public void loadFromRepository(long revision) throws SVNException { myBaseFile = SVNFileUtil.createUniqueFile(getTempDirectory(), ".diff", ".tmp", myIsUseGlobalTmp); OutputStream os = null; myBaseProperties = new SVNProperties(); try { os = SVNFileUtil.openFileForWriting(myBaseFile); myRepos.getFile(myRepositoryPath, revision, myBaseProperties, new SVNCancellableOutputStream(os, myCancelHandler)); } finally { SVNFileUtil.closeFile(os); } }