0001: /**
0002: * @copyright
0003: * ====================================================================
0004: * Copyright (c) 2003-2004 CollabNet. All rights reserved.
0005: *
0006: * This software is licensed as described in the file COPYING, which
0007: * you should have received as part of this distribution. The terms
0008: * are also available at http://subversion.tigris.org/license-1.html.
0009: * If newer versions of this license are posted there, you may use a
0010: * newer version instead, at your option.
0011: *
0012: * This software consists of voluntary contributions made by many
0013: * individuals. For exact contribution history, see the revision
0014: * history and logs, available at http://subversion.tigris.org/.
0015: * ====================================================================
0016: * @endcopyright
0017: */package org.tigris.subversion.javahl;
0018:
0019: import java.io.OutputStream;
0020:
0021: /**
0022: * This class provides a threadsafe wrapped for SVNClient
0023: */
0024: public class SVNClientSynchronized implements SVNClientInterface {
0025: /**
0026: * the wrapped object, which does all the work
0027: */
0028: private SVNClient worker;
0029:
0030: /**
0031: * our class, we synchronize on that.
0032: */
0033: static private Class clazz = SVNClientSynchronized.class;
0034:
0035: /**
0036: * Create our worker
0037: */
0038: public SVNClientSynchronized() {
0039: synchronized (clazz) {
0040: worker = new SVNClient();
0041: }
0042: }
0043:
0044: /**
0045: * release the native peer (should not depend on finalize)
0046: */
0047: public void dispose() {
0048: worker.dispose();
0049: }
0050:
0051: /**
0052: * @return Version information about the underlying native libraries.
0053: */
0054: public Version getVersion() {
0055: synchronized (clazz) {
0056: return worker.getVersion();
0057: }
0058: }
0059:
0060: /**
0061: * @return The name of the working copy's administrative
0062: * directory, which is usually <code>.svn</code>.
0063: * @see <a
0064: * href="http://svn.collab.net/repos/svn/trunk/notes/asp-dot-net-hack.txt">Instructions</a>
0065: * on changing this as a work-around for the behavior of ASP.Net
0066: * on Windows.
0067: * @since 1.3
0068: */
0069: public String getAdminDirectoryName() {
0070: synchronized (clazz) {
0071: return worker.getAdminDirectoryName();
0072: }
0073: }
0074:
0075: /**
0076: * @param name The name of the directory to compare.
0077: * @return Whether <code>name</code> is that of a working copy
0078: * administrative directory.
0079: * @since 1.3
0080: */
0081: public boolean isAdminDirectory(String name) {
0082: synchronized (clazz) {
0083: return worker.isAdminDirectory(name);
0084: }
0085: }
0086:
0087: /**
0088: * Returns the last destination path submitted.
0089: * @deprecated
0090: * @return path in Subversion format.
0091: */
0092: public String getLastPath() {
0093: synchronized (clazz) {
0094: return worker.getLastPath();
0095: }
0096: }
0097:
0098: /**
0099: * List a directory or file of the working copy.
0100: *
0101: * @param path Path to explore.
0102: * @param descend Recurse into subdirectories if they exist.
0103: * @param onServer Request status information from server.
0104: * @param getAll get status for uninteristing files (unchanged).
0105: * @return Array of Status entries.
0106: */
0107: public Status[] status(String path, boolean descend,
0108: boolean onServer, boolean getAll) throws ClientException {
0109: synchronized (clazz) {
0110: return worker.status(path, descend, onServer, getAll);
0111: }
0112: }
0113:
0114: /**
0115: * List a directory or file of the working copy.
0116: *
0117: * @param path Path to explore.
0118: * @param descend Recurse into subdirectories if they exist.
0119: * @param onServer Request status information from server.
0120: * @param getAll get status for uninteristing files (unchanged).
0121: * @param noIgnore get status for normaly ignored files and directories.
0122: * @return Array of Status entries.
0123: */
0124: public Status[] status(String path, boolean descend,
0125: boolean onServer, boolean getAll, boolean noIgnore)
0126: throws ClientException {
0127: synchronized (clazz) {
0128: return worker.status(path, descend, onServer, getAll,
0129: noIgnore);
0130: }
0131: }
0132:
0133: /**
0134: * List a directory or file of the working copy.
0135: *
0136: * @param path Path to explore.
0137: * @param descend Recurse into subdirectories if they exist.
0138: * @param onServer Request status information from server.
0139: * @param getAll get status for uninteristing files (unchanged).
0140: * @param noIgnore get status for normaly ignored files and
0141: * directories.
0142: * @param ignoreExternals if externals are ignored during checkout
0143: * @return Array of Status entries.
0144: * @since 1.2
0145: */
0146: public Status[] status(String path, boolean descend,
0147: boolean onServer, boolean getAll, boolean noIgnore,
0148: boolean ignoreExternals) throws ClientException {
0149: synchronized (clazz) {
0150: return worker.status(path, descend, onServer, getAll,
0151: noIgnore, ignoreExternals);
0152: }
0153: }
0154:
0155: /**
0156: * Lists the directory entries of an url on the server.
0157: * @param url the url to list
0158: * @param revision the revision to list
0159: * @param recurse recurse into subdirectories
0160: * @return Array of DirEntry objects.
0161: */
0162: public DirEntry[] list(String url, Revision revision,
0163: boolean recurse) throws ClientException {
0164: synchronized (clazz) {
0165: return worker.list(url, revision, recurse);
0166: }
0167: }
0168:
0169: /**
0170: * Lists the directory entries of an url on the server.
0171: *
0172: * @param url the url to list
0173: * @param revision the revision to list
0174: * @param pegRevision the revision to interpret url
0175: * @param recurse recurse into subdirectories
0176: * @return Array of DirEntry objects.
0177: * @since 1.2
0178: */
0179: public DirEntry[] list(String url, Revision revision,
0180: Revision pegRevision, boolean recurse)
0181: throws ClientException {
0182: synchronized (clazz) {
0183: return worker.list(url, revision, pegRevision, recurse);
0184: }
0185: }
0186:
0187: /**
0188: * Returns the status of a single file in the path.
0189: *
0190: * @param path File to gather status.
0191: * @param onServer Request status information from the server.
0192: * @return the subversion status of the file.
0193: */
0194: public Status singleStatus(String path, boolean onServer)
0195: throws ClientException {
0196: synchronized (clazz) {
0197: return worker.singleStatus(path, onServer);
0198: }
0199: }
0200:
0201: /**
0202: * Sets the username used for authentification.
0203: * @param username the username
0204: */
0205: public void username(String username) {
0206: synchronized (clazz) {
0207: worker.username(username);
0208: }
0209: }
0210:
0211: /**
0212: * Sets the password used for authification.
0213: * @param password the password
0214: */
0215: public void password(String password) {
0216: synchronized (clazz) {
0217: worker.password(password);
0218: }
0219: }
0220:
0221: /**
0222: * Register callback interface to supply username and password on demand
0223: * @param prompt the callback interface
0224: */
0225: public void setPrompt(PromptUserPassword prompt) {
0226: synchronized (clazz) {
0227: worker.setPrompt(prompt);
0228: }
0229: }
0230:
0231: /**
0232: * Retrieve the log messages for an item
0233: * @param path path or url to get the log message for.
0234: * @param revisionStart first revision to show
0235: * @param revisionEnd last revision to show
0236: * @return array of LogMessages
0237: */
0238: public LogMessage[] logMessages(String path,
0239: Revision revisionStart, Revision revisionEnd)
0240: throws ClientException {
0241: synchronized (clazz) {
0242: return worker.logMessages(path, revisionStart, revisionEnd,
0243: true, false);
0244: }
0245: }
0246:
0247: /**
0248: * Retrieve the log messages for an item
0249: * @param path path or url to get the log message for.
0250: * @param revisionStart first revision to show
0251: * @param revisionEnd last revision to show
0252: * @param stopOnCopy do not continue on copy operations
0253: * @return array of LogMessages
0254: */
0255: public LogMessage[] logMessages(String path,
0256: Revision revisionStart, Revision revisionEnd,
0257: boolean stopOnCopy) throws ClientException {
0258: synchronized (clazz) {
0259: return worker.logMessages(path, revisionStart, revisionEnd,
0260: stopOnCopy, false);
0261: }
0262: }
0263:
0264: /**
0265: * Retrieve the log messages for an item
0266: * @param path path or url to get the log message for.
0267: * @param revisionStart first revision to show
0268: * @param revisionEnd last revision to show
0269: * @param stopOnCopy do not continue on copy operations
0270: * @param discoverPath returns the paths of the changed items in the
0271: * returned objects
0272: * @return array of LogMessages
0273: */
0274: public LogMessage[] logMessages(String path,
0275: Revision revisionStart, Revision revisionEnd,
0276: boolean stopOnCopy, boolean discoverPath)
0277: throws ClientException {
0278: synchronized (clazz) {
0279: return worker.logMessages(path, revisionStart, revisionEnd,
0280: stopOnCopy, discoverPath);
0281: }
0282: }
0283:
0284: /**
0285: * Retrieve the log messages for an item
0286: * @param path path or url to get the log message for.
0287: * @param revisionStart first revision to show
0288: * @param revisionEnd last revision to show
0289: * @param stopOnCopy do not continue on copy operations
0290: * @param discoverPath returns the paths of the changed items in the
0291: * returned objects
0292: * @param limit limit the number of log messages (if 0 or less no
0293: * limit)
0294: * @return array of LogMessages
0295: * @since 1.2
0296: */
0297: public LogMessage[] logMessages(String path,
0298: Revision revisionStart, Revision revisionEnd,
0299: boolean stopOnCopy, boolean discoverPath, long limit)
0300: throws ClientException {
0301: synchronized (clazz) {
0302: return worker.logMessages(path, revisionStart, revisionEnd,
0303: stopOnCopy, discoverPath, limit);
0304: }
0305: }
0306:
0307: /**
0308: * Executes a revision checkout.
0309: * @param moduleName name of the module to checkout.
0310: * @param destPath destination directory for checkout.
0311: * @param revision the revision to checkout.
0312: * @param pegRevision the peg revision to interpret the path
0313: * @param recurse whether you want it to checkout files recursively.
0314: * @param ignoreExternals if externals are ignored during checkout
0315: * @exception ClientException
0316: * @since 1.2
0317: */
0318: public long checkout(String moduleName, String destPath,
0319: Revision revision, Revision pegRevision, boolean recurse,
0320: boolean ignoreExternals) throws ClientException {
0321: synchronized (clazz) {
0322: return worker.checkout(moduleName, destPath, revision,
0323: pegRevision, recurse, ignoreExternals);
0324: }
0325: }
0326:
0327: /**
0328: * Executes a revision checkout.
0329: * @param moduleName name of the module to checkout.
0330: * @param destPath destination directory for checkout.
0331: * @param revision the revision to checkout.
0332: * @param recurse whether you want it to checkout files recursively.
0333: * @exception ClientException
0334: */
0335: public long checkout(String moduleName, String destPath,
0336: Revision revision, boolean recurse) throws ClientException {
0337: synchronized (clazz) {
0338: return worker.checkout(moduleName, destPath, revision,
0339: recurse);
0340: }
0341: }
0342:
0343: /**
0344: * Sets the notification callback used to send processing information back
0345: * to the calling program.
0346: * @param notify listener that the SVN library should call on many
0347: * file operations.
0348: * @deprecated use notification2 instead
0349: */
0350: public void notification(Notify notify) {
0351: synchronized (clazz) {
0352: worker.notification(notify);
0353: }
0354: }
0355:
0356: /**
0357: * Sets the notification callback used to send processing information back
0358: * to the calling program.
0359: *
0360: * @param notify listener that the SVN library should call on many
0361: * file operations.
0362: * @since 1.2
0363: */
0364: public void notification2(Notify2 notify) {
0365: synchronized (clazz) {
0366: worker.notification2(notify);
0367: }
0368: }
0369:
0370: /**
0371: * Sets the commit message handler. This allows more complex commit message
0372: * with the list of the elements to be commited as input.
0373: * @param messageHandler callback for entering commit messages
0374: * if this is set the message parameter is ignored.
0375: */
0376: public void commitMessageHandler(CommitMessage messageHandler) {
0377: synchronized (clazz) {
0378: worker.commitMessageHandler(messageHandler);
0379: }
0380: }
0381:
0382: /**
0383: * Sets a file for deletion.
0384: * @param path path or url to be deleted
0385: * @param message if path is a url, this will be the commit message.
0386: * @param force delete even when there are local modifications.
0387: * @exception ClientException
0388: */
0389: public void remove(String[] path, String message, boolean force)
0390: throws ClientException {
0391: synchronized (clazz) {
0392: worker.remove(path, message, force);
0393: }
0394: }
0395:
0396: /**
0397: * Reverts a file to a pristine state.
0398: * @param path path of the file.
0399: * @param recurse recurse into subdirectories
0400: * @exception ClientException
0401: */
0402: public void revert(String path, boolean recurse)
0403: throws ClientException {
0404: synchronized (clazz) {
0405: worker.revert(path, recurse);
0406: }
0407: }
0408:
0409: /**
0410: * Adds a file to the repository.
0411: * @param path path to be added.
0412: * @param recurse recurse into subdirectories
0413: * @exception ClientException
0414: */
0415: public void add(String path, boolean recurse)
0416: throws ClientException {
0417: synchronized (clazz) {
0418: worker.add(path, recurse);
0419: }
0420: }
0421:
0422: /**
0423: * Adds a file to the repository.
0424: * @param path path to be added.
0425: * @param recurse recurse into subdirectories
0426: * @param force if adding a directory and recurse true and path is a
0427: * directory, all not already managed files are added.
0428: * @exception ClientException
0429: * @since 1.2
0430: */
0431: public void add(String path, boolean recurse, boolean force)
0432: throws ClientException {
0433: synchronized (clazz) {
0434: worker.add(path, recurse, force);
0435: }
0436: }
0437:
0438: /**
0439: * Updates the directory or file from repository
0440: * @param path target file.
0441: * @param revision the revision number to update.
0442: * Revision.HEAD will update to the
0443: * latest revision.
0444: * @param recurse recursively update.
0445: * @exception ClientException
0446: */
0447: public long update(String path, Revision revision, boolean recurse)
0448: throws ClientException {
0449: synchronized (clazz) {
0450: return worker.update(path, revision, recurse);
0451: }
0452: }
0453:
0454: /**
0455: * Updates the directories or files from repository
0456: * @param path array of target files.
0457: * @param revision the revision number to update.
0458: * Revision.HEAD will update to the
0459: * latest revision.
0460: * @param recurse recursively update.
0461: * @param ignoreExternals if externals are ignored during update
0462: * @exception ClientException
0463: * @since 1.2
0464: */
0465: public long[] update(String[] path, Revision revision,
0466: boolean recurse, boolean ignoreExternals)
0467: throws ClientException {
0468: synchronized (clazz) {
0469: return worker.update(path, revision, recurse,
0470: ignoreExternals);
0471: }
0472: }
0473:
0474: /**
0475: * Commits changes to the repository.
0476: * @param path files to commit.
0477: * @param message log message.
0478: * @param recurse whether the operation should be done recursively.
0479: * @return Returns a long representing the revision. It returns a
0480: * -1 if the revision number is invalid.
0481: * @exception ClientException
0482: */
0483: public long commit(String[] path, String message, boolean recurse)
0484: throws ClientException {
0485: synchronized (clazz) {
0486: return worker.commit(path, message, recurse, false);
0487: }
0488: }
0489:
0490: /**
0491: * Copies a versioned file with the history preserved.
0492: * @param srcPath source path or url
0493: * @param destPath destination path or url
0494: * @param message commit message if destPath is an url
0495: * @param revision source revision
0496: * @exception ClientException
0497: */
0498: public void copy(String srcPath, String destPath, String message,
0499: Revision revision) throws ClientException {
0500: synchronized (clazz) {
0501: worker.copy(srcPath, destPath, message, revision);
0502: }
0503: }
0504:
0505: /**
0506: * Moves or renames a file.
0507: * @param srcPath source path or url
0508: * @param destPath destination path or url
0509: * @param message commit message if destPath is an url
0510: * @param revision source revision
0511: * @param force even with local modifications.
0512: * @exception ClientException
0513: * @since 1.2
0514: */
0515: public void move(String srcPath, String destPath, String message,
0516: Revision revision, boolean force) throws ClientException {
0517: synchronized (clazz) {
0518: worker.move(srcPath, destPath, message, revision, force);
0519: }
0520: }
0521:
0522: /**
0523: * Moves or renames a file.
0524: *
0525: * @param srcPath source path or url
0526: * @param destPath destination path or url
0527: * @param message commit message if destPath is an url
0528: * @param force even with local modifications.
0529: * @throws ClientException
0530: *
0531: */
0532: public void move(String srcPath, String destPath, String message,
0533: boolean force) throws ClientException {
0534: synchronized (clazz) {
0535: worker.move(srcPath, destPath, message, force);
0536: }
0537: }
0538:
0539: /**
0540: * Creates a directory directly in a repository or creates a
0541: * directory on disk and schedules it for addition.
0542: * @param path directories to be created
0543: * @param message commit message to used if path contains urls
0544: * @exception ClientException
0545: */
0546: public void mkdir(String[] path, String message)
0547: throws ClientException {
0548: synchronized (clazz) {
0549: worker.mkdir(path, message);
0550: }
0551: }
0552:
0553: /**
0554: * Recursively cleans up a local directory, finishing any
0555: * incomplete operations, removing lockfiles, etc.
0556: * @param path a local directory.
0557: * @exception ClientException
0558: */
0559: public void cleanup(String path) throws ClientException {
0560: synchronized (clazz) {
0561: worker.cleanup(path);
0562: }
0563: }
0564:
0565: /**
0566: * Removes the 'conflicted' state on a file.
0567: * @param path path to cleanup
0568: * @param recurse recurce into subdirectories
0569: * @exception ClientException
0570: */
0571: public void resolved(String path, boolean recurse)
0572: throws ClientException {
0573: synchronized (clazz) {
0574: worker.resolved(path, recurse);
0575: }
0576: }
0577:
0578: /**
0579: * Exports the contents of either a subversion repository into a
0580: * 'clean' directory (meaning a directory with no administrative
0581: * directories).
0582: * @param srcPath the url of the repository path to be exported
0583: * @param destPath a destination path that must not already exist.
0584: * @param revision the revsion to be exported
0585: * @param force set if it is ok to overwrite local files
0586: * @exception ClientException
0587: */
0588: public long doExport(String srcPath, String destPath,
0589: Revision revision, boolean force) throws ClientException {
0590: synchronized (clazz) {
0591: return worker.doExport(srcPath, destPath, revision, force);
0592: }
0593: }
0594:
0595: /**
0596: * Exports the contents of either a subversion repository into a
0597: * 'clean' directory (meaning a directory with no administrative
0598: * directories).
0599: *
0600: * @param srcPath the url of the repository path to be exported
0601: * @param destPath a destination path that must not already exist.
0602: * @param revision the revsion to be exported
0603: * @param pegRevision the revision to interpret srcPath
0604: * @param force set if it is ok to overwrite local files
0605: * @param ignoreExternals ignore external during export
0606: * @param recurse recurse to subdirectories
0607: * @param nativeEOL which EOL characters to use during export
0608: * @throws ClientException
0609: * @since 1.2
0610: */
0611: public long doExport(String srcPath, String destPath,
0612: Revision revision, Revision pegRevision, boolean force,
0613: boolean ignoreExternals, boolean recurse, String nativeEOL)
0614: throws ClientException {
0615: synchronized (clazz) {
0616: return worker.doExport(srcPath, destPath, revision,
0617: pegRevision, force, ignoreExternals, recurse,
0618: nativeEOL);
0619: }
0620: }
0621:
0622: /**
0623: * Update local copy to mirror a new url.
0624: * @param path the working copy path
0625: * @param url the new url for the working copy
0626: * @param revision the new base revision of working copy
0627: * @param recurse traverse into subdirectories
0628: * @exception ClientException
0629: */
0630: public long doSwitch(String path, String url, Revision revision,
0631: boolean recurse) throws ClientException {
0632: synchronized (clazz) {
0633: return worker.doSwitch(path, url, revision, recurse);
0634: }
0635: }
0636:
0637: /**
0638: * Import a file or directory into a repository directory at
0639: * head.
0640: * @param path the local path
0641: * @param url the target url
0642: * @param message the log message.
0643: * @param recurse traverse into subdirectories
0644: * @exception ClientException
0645: */
0646: public void doImport(String path, String url, String message,
0647: boolean recurse) throws ClientException {
0648: synchronized (clazz) {
0649: worker.doImport(path, url, message, recurse);
0650: }
0651: }
0652:
0653: /**
0654: * Merge changes from two paths into a new local path.
0655: * @param path1 first path or url
0656: * @param revision1 first revision
0657: * @param path2 second path or url
0658: * @param revision2 second revision
0659: * @param localPath target local path
0660: * @param force overwrite local changes
0661: * @param recurse traverse into subdirectories
0662: * @exception ClientException
0663: */
0664: public void merge(String path1, Revision revision1, String path2,
0665: Revision revision2, String localPath, boolean force,
0666: boolean recurse) throws ClientException {
0667: synchronized (clazz) {
0668: worker.merge(path1, revision1, path2, revision2, localPath,
0669: force, recurse);
0670: }
0671: }
0672:
0673: /**
0674: * Merge changes from two paths into a new local path.
0675: *
0676: * @param path1 first path or url
0677: * @param revision1 first revision
0678: * @param path2 second path or url
0679: * @param revision2 second revision
0680: * @param localPath target local path
0681: * @param force overwrite local changes
0682: * @param recurse traverse into subdirectories
0683: * @param ignoreAncestry ignore if files are not related
0684: * @param dryRun do not change anything
0685: * @throws ClientException
0686: * @since 1.2
0687: */
0688: public void merge(String path1, Revision revision1, String path2,
0689: Revision revision2, String localPath, boolean force,
0690: boolean recurse, boolean ignoreAncestry, boolean dryRun)
0691: throws ClientException {
0692: synchronized (clazz) {
0693: worker.merge(path1, revision1, path2, revision2, localPath,
0694: force, recurse, ignoreAncestry, dryRun);
0695: }
0696: }
0697:
0698: /**
0699: * Merge changes from two paths into a new local path.
0700: *
0701: * @param path path or url
0702: * @param pegRevision revision to interpret path
0703: * @param revision1 first revision
0704: * @param revision2 second revision
0705: * @param localPath target local path
0706: * @param force overwrite local changes
0707: * @param recurse traverse into subdirectories
0708: * @param ignoreAncestry ignore if files are not related
0709: * @param dryRun do not change anything
0710: * @throws ClientException
0711: * @since 1.2
0712: */
0713: public void merge(String path, Revision pegRevision,
0714: Revision revision1, Revision revision2, String localPath,
0715: boolean force, boolean recurse, boolean ignoreAncestry,
0716: boolean dryRun) throws ClientException {
0717: synchronized (clazz) {
0718: worker.merge(path, pegRevision, revision1, revision2,
0719: localPath, force, recurse, ignoreAncestry, dryRun);
0720: }
0721: }
0722:
0723: /**
0724: * Display the differences between two paths
0725: * @param target1 first path or url
0726: * @param revision1 first revision
0727: * @param target2 second path or url
0728: * @param revision2 second revision
0729: * @param outFileName file name where difference are written
0730: * @param recurse traverse into subdirectories
0731: * @exception ClientException
0732: */
0733: public void diff(String target1, Revision revision1,
0734: String target2, Revision revision2, String outFileName,
0735: boolean recurse) throws ClientException {
0736: synchronized (clazz) {
0737: worker.diff(target1, revision1, target2, revision2,
0738: outFileName, recurse);
0739: }
0740: }
0741:
0742: /**
0743: * Display the differences between two paths
0744: *
0745: * @param target1 first path or url
0746: * @param revision1 first revision
0747: * @param target2 second path or url
0748: * @param revision2 second revision
0749: * @param outFileName file name where difference are written
0750: * @param recurse traverse into subdirectories
0751: * @param ignoreAncestry ignore if files are not related
0752: * @param noDiffDeleted no output on deleted files
0753: * @param force diff even on binary files
0754: * @throws ClientException
0755: * @since 1.2
0756: */
0757: public void diff(String target1, Revision revision1,
0758: String target2, Revision revision2, String outFileName,
0759: boolean recurse, boolean ignoreAncestry,
0760: boolean noDiffDeleted, boolean force)
0761: throws ClientException {
0762: synchronized (clazz) {
0763: worker.diff(target1, revision1, target2, revision2,
0764: outFileName, recurse, ignoreAncestry,
0765: noDiffDeleted, force);
0766: }
0767: }
0768:
0769: /**
0770: * Display the differences between two paths
0771: *
0772: * @param target path or url
0773: * @param pegRevision revision tointerpret target
0774: * @param startRevision first Revision to compare
0775: * @param endRevision second Revision to compare
0776: * @param outFileName file name where difference are written
0777: * @param recurse traverse into subdirectories
0778: * @param ignoreAncestry ignore if files are not related
0779: * @param noDiffDeleted no output on deleted files
0780: * @param force diff even on binary files
0781: * @throws ClientException
0782: * @since 1.2
0783: */
0784: public void diff(String target, Revision pegRevision,
0785: Revision startRevision, Revision endRevision,
0786: String outFileName, boolean recurse,
0787: boolean ignoreAncestry, boolean noDiffDeleted, boolean force)
0788: throws ClientException {
0789: synchronized (clazz) {
0790: worker.diff(target, pegRevision, startRevision,
0791: endRevision, outFileName, recurse, ignoreAncestry,
0792: noDiffDeleted, force);
0793: }
0794: }
0795:
0796: /**
0797: * Retrieves the properties of an item
0798: * @param path the path of the item
0799: * @return array of property objects
0800: */
0801: public PropertyData[] properties(String path)
0802: throws ClientException {
0803: synchronized (clazz) {
0804: return worker.properties(path);
0805: }
0806: }
0807:
0808: /**
0809: * Retrieves the properties of an item
0810: *
0811: * @param path the path of the item
0812: * @param revision the revision of the item
0813: * @return array of property objects
0814: * @since 1.2
0815: */
0816: public PropertyData[] properties(String path, Revision revision)
0817: throws ClientException {
0818: synchronized (clazz) {
0819: return worker.properties(path, revision);
0820: }
0821: }
0822:
0823: /**
0824: * Retrieves the properties of an item
0825: *
0826: * @param path the path of the item
0827: * @param revision the revision of the item
0828: * @param pegRevision the revision to interpret path
0829: * @return array of property objects
0830: * @since 1.2
0831: */
0832: public PropertyData[] properties(String path, Revision revision,
0833: Revision pegRevision) throws ClientException {
0834: synchronized (clazz) {
0835: return properties(path, revision, pegRevision);
0836: }
0837: }
0838:
0839: /**
0840: * Sets one property of an item with a String value
0841: * @param path path of the item
0842: * @param name name of the property
0843: * @param value new value of the property
0844: * @param recurse set property also on the subdirectories
0845: * @throws ClientException
0846: */
0847: public void propertySet(String path, String name, String value,
0848: boolean recurse) throws ClientException {
0849: synchronized (clazz) {
0850: worker.propertySet(path, name, value, recurse);
0851: }
0852: }
0853:
0854: /**
0855: * Sets one property of an item with a String value
0856: *
0857: * @param path path of the item
0858: * @param name name of the property
0859: * @param value new value of the property
0860: * @param recurse set property also on the subdirectories
0861: * @param force do not check if the value is valid
0862: * @throws ClientException
0863: * @since 1.2
0864: */
0865: public void propertySet(String path, String name, String value,
0866: boolean recurse, boolean force) throws ClientException {
0867: synchronized (clazz) {
0868: worker.propertySet(path, name, value, recurse, force);
0869: }
0870: }
0871:
0872: /**
0873: * Sets one property of an item with a byte array value
0874: * @param path path of the item
0875: * @param name name of the property
0876: * @param value new value of the property
0877: * @param recurse set property also on the subdirectories
0878: * @throws ClientException
0879: */
0880: public void propertySet(String path, String name, byte[] value,
0881: boolean recurse) throws ClientException {
0882: synchronized (clazz) {
0883: worker.propertySet(path, name, value, recurse);
0884: }
0885: }
0886:
0887: /**
0888: * Sets one property of an item with a byte array value
0889: *
0890: * @param path path of the item
0891: * @param name name of the property
0892: * @param value new value of the property
0893: * @param recurse set property also on the subdirectories
0894: * @param force do not check if the value is valid
0895: * @throws ClientException
0896: * @since 1.2
0897: */
0898: public void propertySet(String path, String name, byte[] value,
0899: boolean recurse, boolean force) throws ClientException {
0900: synchronized (clazz) {
0901: worker.propertySet(path, name, value, recurse, force);
0902: }
0903: }
0904:
0905: /**
0906: * Remove one property of an item.
0907: * @param path path of the item
0908: * @param name name of the property
0909: * @param recurse remove the property also on subdirectories
0910: * @throws ClientException
0911: */
0912: public void propertyRemove(String path, String name, boolean recurse)
0913: throws ClientException {
0914: synchronized (clazz) {
0915: worker.propertyRemove(path, name, recurse);
0916: }
0917: }
0918:
0919: /**
0920: * Create and sets one property of an item with a String value
0921: * @param path path of the item
0922: * @param name name of the property
0923: * @param value new value of the property
0924: * @param recurse set property also on the subdirectories
0925: * @throws ClientException
0926: */
0927: public void propertyCreate(String path, String name, String value,
0928: boolean recurse) throws ClientException {
0929: synchronized (clazz) {
0930: worker.propertyCreate(path, name, value, recurse);
0931: }
0932: }
0933:
0934: /**
0935: * Create and sets one property of an item with a String value
0936: *
0937: * @param path path of the item
0938: * @param name name of the property
0939: * @param value new value of the property
0940: * @param recurse set property also on the subdirectories
0941: * @param force do not check if the value is valid
0942: * @throws ClientException
0943: * @since 1.2
0944: */
0945: public void propertyCreate(String path, String name, String value,
0946: boolean recurse, boolean force) throws ClientException {
0947: synchronized (clazz) {
0948: worker.propertyCreate(path, name, value, recurse, force);
0949: }
0950: }
0951:
0952: /**
0953: * Create and sets one property of an item with a byte array value
0954: * @param path path of the item
0955: * @param name name of the property
0956: * @param value new value of the property
0957: * @param recurse set property also on the subdirectories
0958: * @throws ClientException
0959: */
0960: public void propertyCreate(String path, String name, byte[] value,
0961: boolean recurse) throws ClientException {
0962: synchronized (clazz) {
0963: worker.propertyCreate(path, name, value, recurse);
0964: }
0965: }
0966:
0967: /**
0968: * Create and sets one property of an item with a byte array value
0969: *
0970: * @param path path of the item
0971: * @param name name of the property
0972: * @param value new value of the property
0973: * @param recurse set property also on the subdirectories
0974: * @param force do not check if the value is valid
0975: * @throws ClientException
0976: * @since 1.2
0977: */
0978: public void propertyCreate(String path, String name, byte[] value,
0979: boolean recurse, boolean force) throws ClientException {
0980: synchronized (clazz) {
0981: worker.propertyCreate(path, name, value, recurse, force);
0982: }
0983: }
0984:
0985: /**
0986: * Retrieve one revsision property of one item
0987: * @param path path of the item
0988: * @param name name of the property
0989: * @param rev revision to retrieve
0990: * @return the Property
0991: * @throws ClientException
0992: */
0993: public PropertyData revProperty(String path, String name,
0994: Revision rev) throws ClientException {
0995: synchronized (clazz) {
0996: return worker.revProperty(path, name, rev);
0997: }
0998: }
0999:
1000: /**
1001: * Retrieve all revsision properties of one item
1002: *
1003: * @param path path of the item
1004: * @param rev revision to retrieve
1005: * @return the Properties
1006: * @throws ClientException
1007: * @since 1.2
1008: */
1009: public PropertyData[] revProperties(String path, Revision rev)
1010: throws ClientException {
1011: synchronized (clazz) {
1012: return worker.revProperties(path, rev);
1013: }
1014: }
1015:
1016: /**
1017: * set one revsision property of one item
1018: * @param path path of the item
1019: * @param name name of the property
1020: * @param rev revision to retrieve
1021: * @param value value of the property
1022: * @param force
1023: * @throws ClientException
1024: * @since 1.2
1025: */
1026: public void setRevProperty(String path, String name, Revision rev,
1027: String value, boolean force) throws ClientException {
1028: synchronized (clazz) {
1029: worker.setRevProperty(path, name, rev, value, force);
1030: }
1031: }
1032:
1033: /**
1034: * Retrieve one property of one iten
1035: * @param path path of the item
1036: * @param name name of property
1037: * @return the Property
1038: * @throws ClientException
1039: */
1040: public PropertyData propertyGet(String path, String name)
1041: throws ClientException {
1042: synchronized (clazz) {
1043: return worker.propertyGet(path, name);
1044: }
1045: }
1046:
1047: /**
1048: * Retrieve one property of one iten
1049: *
1050: * @param path path of the item
1051: * @param name name of property
1052: * @param revision revision of the item
1053: * @return the Property
1054: * @throws ClientException
1055: * @since 1.2
1056: */
1057: public PropertyData propertyGet(String path, String name,
1058: Revision revision) throws ClientException {
1059: synchronized (clazz) {
1060: return worker.propertyGet(path, name, revision);
1061: }
1062: }
1063:
1064: /**
1065: * Retrieve one property of one iten
1066: *
1067: * @param path path of the item
1068: * @param name name of property
1069: * @param revision revision of the item
1070: * @param pegRevision the revision to interpret path
1071: * @return the Property
1072: * @throws ClientException
1073: * @since 1.2
1074: */
1075: public PropertyData propertyGet(String path, String name,
1076: Revision revision, Revision pegRevision)
1077: throws ClientException {
1078: synchronized (clazz) {
1079: return worker
1080: .propertyGet(path, name, revision, pegRevision);
1081: }
1082: }
1083:
1084: /**
1085: * Retrieve the content of a file
1086: * @param path the path of the file
1087: * @param revision the revision to retrieve
1088: * @return the content as byte array
1089: * @throws ClientException
1090: */
1091: public byte[] fileContent(String path, Revision revision)
1092: throws ClientException {
1093: synchronized (clazz) {
1094: return worker.fileContent(path, revision);
1095: }
1096: }
1097:
1098: /**
1099: * Retrieve the content of a file
1100: *
1101: * @param path the path of the file
1102: * @param revision the revision to retrieve
1103: * @param pegRevision the revision to interpret path
1104: * @return the content as byte array
1105: * @throws ClientException
1106: * @since 1.2
1107: */
1108: public byte[] fileContent(String path, Revision revision,
1109: Revision pegRevision) throws ClientException {
1110: synchronized (clazz) {
1111: return worker.fileContent(path, revision, pegRevision);
1112: }
1113: }
1114:
1115: /**
1116: * Write the file's content to the specified output stream.
1117: *
1118: * @param path the path of the file
1119: * @param revision the revision to retrieve
1120: * @param pegRevision the revision at which to interpret the path
1121: * @param the stream to write the file's content to
1122: * @throws ClientException
1123: */
1124: public void streamFileContent(String path, Revision revision,
1125: Revision pegRevision, int bufferSize, OutputStream stream)
1126: throws ClientException {
1127: synchronized (clazz) {
1128: worker.streamFileContent(path, revision, pegRevision,
1129: bufferSize, stream);
1130: }
1131: }
1132:
1133: /**
1134: * Rewrite the url's in the working copy
1135: * @param from old url
1136: * @param to new url
1137: * @param path working copy path
1138: * @param recurse recurse into subdirectories
1139: * @throws ClientException
1140: */
1141: public void relocate(String from, String to, String path,
1142: boolean recurse) throws ClientException {
1143: synchronized (clazz) {
1144: worker.relocate(from, to, path, recurse);
1145: }
1146: }
1147:
1148: /**
1149: * Return for each line of the file, the author and the revision of the
1150: * last together with the content.
1151: * @deprecated
1152: * @param path the path
1153: * @param revisionStart the first revision to show
1154: * @param revisionEnd the last revision to show
1155: * @return the content together with author and revision of last change
1156: * @throws ClientException
1157: */
1158: public byte[] blame(String path, Revision revisionStart,
1159: Revision revisionEnd) throws ClientException {
1160: synchronized (clazz) {
1161: return worker.blame(path, revisionStart, revisionEnd);
1162: }
1163: }
1164:
1165: /**
1166: * Retrieve the content together with the author, the revision and the date
1167: * of the last change of each line
1168: * @param path the path
1169: * @param revisionStart the first revision to show
1170: * @param revisionEnd the last revision to show
1171: * @param callback callback to receive the file content and the other
1172: * information
1173: * @throws ClientException
1174: */
1175: public void blame(String path, Revision revisionStart,
1176: Revision revisionEnd, BlameCallback callback)
1177: throws ClientException {
1178: synchronized (clazz) {
1179: worker.blame(path, revisionStart, revisionEnd, callback);
1180: }
1181: }
1182:
1183: /**
1184: * Retrieve the content together with the author, the revision and the date
1185: * of the last change of each line
1186: * @param path the path
1187: * @param pegRevision the revision to interpret the path
1188: * @param revisionStart the first revision to show
1189: * @param revisionEnd the last revision to show
1190: * @param callback callback to receive the file content and the other
1191: * information
1192: * @throws ClientException
1193: * @since 1.2
1194: */
1195: public void blame(String path, Revision pegRevision,
1196: Revision revisionStart, Revision revisionEnd,
1197: BlameCallback callback) throws ClientException {
1198: synchronized (clazz) {
1199: worker.blame(path, pegRevision, revisionStart, revisionEnd,
1200: callback);
1201: }
1202: }
1203:
1204: /**
1205: * Set directory for the configuration information
1206: * @param configDir path of the directory
1207: * @throws ClientException
1208: */
1209: public void setConfigDirectory(String configDir)
1210: throws ClientException {
1211: synchronized (clazz) {
1212: worker.setConfigDirectory(configDir);
1213: }
1214: }
1215:
1216: /**
1217: * Get the configuration directory
1218: * @return the directory
1219: * @throws ClientException
1220: */
1221: public String getConfigDirectory() throws ClientException {
1222: synchronized (clazz) {
1223: return worker.getConfigDirectory();
1224: }
1225: }
1226:
1227: /**
1228: * cancel the active operation
1229: * @throws ClientException
1230: */
1231: public void cancelOperation() throws ClientException {
1232: // this method is not synchronized, because it is designed to be called
1233: // from another thread
1234: worker.cancelOperation();
1235: }
1236:
1237: /**
1238: * Retrieves the working copy information for an item
1239: * @param path path of the item
1240: * @return the information object
1241: * @throws ClientException
1242: */
1243: public Info info(String path) throws ClientException {
1244: synchronized (clazz) {
1245: return worker.info(path);
1246: }
1247: }
1248:
1249: /**
1250: * Commits changes to the repository.
1251: *
1252: * @param path files to commit.
1253: * @param message log message.
1254: * @param recurse whether the operation should be done recursively.
1255: * @param noUnlock do remove any locks
1256: * @return Returns a long representing the revision. It returns a
1257: * -1 if the revision number is invalid.
1258: * @throws ClientException
1259: * @since 1.2
1260: */
1261: public long commit(String[] path, String message, boolean recurse,
1262: boolean noUnlock) throws ClientException {
1263: synchronized (clazz) {
1264: return worker.commit(path, message, recurse, noUnlock);
1265: }
1266: }
1267:
1268: /**
1269: * Lock a working copy item
1270: *
1271: * @param path path of the item
1272: * @param comment
1273: * @param force break an existing lock
1274: * @throws ClientException
1275: * @since 1.2
1276: */
1277: public void lock(String[] path, String comment, boolean force)
1278: throws ClientException {
1279: synchronized (clazz) {
1280: worker.lock(path, comment, force);
1281: }
1282: }
1283:
1284: /**
1285: * Unlock a working copy item
1286: *
1287: * @param path path of the item
1288: * @param force break an existing lock
1289: * @throws ClientException
1290: * @since 1.2
1291: */
1292: public void unlock(String[] path, boolean force)
1293: throws ClientException {
1294: synchronized (clazz) {
1295: worker.unlock(path, force);
1296: }
1297: }
1298:
1299: /**
1300: * Retrieve information about repository or working copy items.
1301: *
1302: * @param pathOrUrl the path or the url of the item
1303: * @param revision the revision of the item to return
1304: * @param pegRevision the revision to interpret pathOrUrl
1305: * @param recurse flag if to recurse, if the item is a directory
1306: * @return the information objects
1307: * @since 1.2
1308: */
1309: public Info2[] info2(String pathOrUrl, Revision revision,
1310: Revision pegRevision, boolean recurse)
1311: throws ClientException {
1312: synchronized (clazz) {
1313: return worker.info2(pathOrUrl, revision, pegRevision,
1314: recurse);
1315: }
1316: }
1317:
1318: /**
1319: * Produce a compact "version number" for a working copy
1320: * @param path path of the working copy
1321: * @param trailUrl to detect switches of the whole working copy
1322: * @param lastChanged last changed rather than current revisions
1323: * @return the compact "version number"
1324: * @throws ClientException
1325: * @since 1.2
1326: */
1327: public String getVersionInfo(String path, String trailUrl,
1328: boolean lastChanged) throws ClientException {
1329: synchronized (clazz) {
1330: return worker.getVersionInfo(path, trailUrl, lastChanged);
1331: }
1332: }
1333:
1334: }
|