for(int i = 0; i < currentFile.getDeltaCount(); i++) { try { InputStream data = currentFile.getTextDelta(i); DAVStatus status = myConnection.doPutDiff(currentFile.getURL(), currentFile.getWorkingURL(), data); data.close(); if (!(status.getResponseCode() ==201 || status.getResponseCode() == 204)) { throw new SVNException("PUT failed: " + status); } } catch (IOException e) { throw new SVNException(e); } }
InputStream combinedData = null; try { combinedData = new ChunkInputStream(currentFile); DAVStatus status = myConnection.doPutDiff(currentFile.getURL(), currentFile.getWorkingURL(), combinedData); if (!(status.getResponseCode() == 201 || status.getResponseCode() == 204)) { throw new SVNException("PUT failed: " + status); } } catch (IOException e1) { SVNErrorManager.error(e1.getMessage()); } finally { SVNFileUtil.closeFile(combinedData); }
    public void closeFile(String path, String textChecksum) throws SVNException {        // do PUT of delta if there was one (diff window + temp file).        // do subsequent PUT of all diff windows...        DAVResource currentFile = (DAVResource) myFilesMap.get(path);        try {            if (currentFile.isAdded() && currentFile.getDeltaCount() == 0) {                OutputStream os = textDeltaChunk(path, SVNDiffWindowBuilder.createReplacementDiffWindow(0));                try {                    os.close();                } catch (IOException e) {                    throw new SVNException(e);                }            }            for(int i = 0; i < currentFile.getDeltaCount(); i++) {                try {                    InputStream data = currentFile.getTextDelta(i);                    DAVStatus status = myConnection.doPutDiff(currentFile.getURL(), currentFile.getWorkingURL(), data);                    data.close();                    if (!(status.getResponseCode() ==201 || status.getResponseCode() == 204)) {                        throw new SVNException("PUT failed: " + status);                    }                } catch (IOException e) {                    throw new SVNException(e);                }             }             // do proppatch if there were property changes.            if (currentFile.getProperties() != null) {                StringBuffer request = DAVProppatchHandler.generatePropertyRequest(null, currentFile.getProperties());                try {                    myConnection.doProppatch(currentFile.getURL(), currentFile.getWorkingURL(), request, null);                } catch (SVNException e) {                    throw new SVNException("At least one property change failed for " + currentFile.getURL());                }            }        } finally {            currentFile.dispose();            myFilesMap.remove(path);        }    }