use of org.tmatesoft.svn.core.wc.SVNWCClient in project intellij-community by JetBrains.
the class SvnKitUpgradeClient method upgrade.
@Override
public void upgrade(@NotNull File path, @NotNull WorkingCopyFormat format, @Nullable ProgressTracker handler) throws VcsException {
validateFormat(format, getSupportedFormats());
SVNWCClient client = myVcs.getSvnKitManager().createUpgradeClient();
client.setEventHandler(toEventHandler(handler));
try {
cleanupIfNecessary(path, format, client, handler);
upgrade(path, format, client, handler);
} catch (SVNException e) {
throw new SvnBindException(e);
}
}
use of org.tmatesoft.svn.core.wc.SVNWCClient in project intellij-community by JetBrains.
the class SvnKitContentClient method getContent.
@Override
public byte[] getContent(@NotNull SvnTarget target, @Nullable SVNRevision revision, @Nullable SVNRevision pegRevision) throws VcsException, FileTooBigRuntimeException {
final int maxSize = VcsUtil.getMaxVcsLoadedFileSize();
ByteArrayOutputStream buffer = new ByteArrayOutputStream() {
@Override
public synchronized void write(int b) {
if (size() > maxSize)
throw new FileTooBigRuntimeException();
super.write(b);
}
@Override
public synchronized void write(byte[] b, int off, int len) {
if (size() > maxSize)
throw new FileTooBigRuntimeException();
super.write(b, off, len);
}
@Override
public synchronized void writeTo(OutputStream out) throws IOException {
if (size() > maxSize)
throw new FileTooBigRuntimeException();
super.writeTo(out);
}
};
SVNWCClient wcClient = myVcs.getSvnKitManager().createWCClient();
try {
if (target.isURL()) {
wcClient.doGetFileContents(target.getURL(), pegRevision, revision, true, buffer);
} else {
wcClient.doGetFileContents(target.getFile(), pegRevision, revision, true, buffer);
}
ContentRevisionCache.checkContentsSize(target.getPathOrUrlString(), buffer.size());
} catch (FileTooBigRuntimeException e) {
ContentRevisionCache.checkContentsSize(target.getPathOrUrlString(), buffer.size());
} catch (SVNException e) {
throw new VcsException(e);
}
return buffer.toByteArray();
}
use of org.tmatesoft.svn.core.wc.SVNWCClient in project intellij-community by JetBrains.
the class SvnKitCleanupClient method cleanup.
@Override
public void cleanup(@NotNull File path, @Nullable ProgressTracker handler) throws VcsException {
SVNWCClient client = myVcs.getSvnKitManager().createWCClient();
client.setEventHandler(toEventHandler(handler));
try {
client.doCleanup(path);
} catch (SVNException e) {
throw new SvnBindException(e);
}
}
Aggregations