⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 svnclientsynchronized.java

📁 subversion-1.4.3-1.tar.gz 配置svn的源码
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
/** * @copyright * ==================================================================== * Copyright (c) 2003-2004 CollabNet.  All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution.  The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * * This software consists of voluntary contributions made by many * individuals.  For exact contribution history, see the revision * history and logs, available at http://subversion.tigris.org/. * ==================================================================== * @endcopyright */package org.tigris.subversion.javahl;import java.io.OutputStream;/** * This class provides a threadsafe wrapped for SVNClient */public class SVNClientSynchronized implements SVNClientInterface{    /**     * the wrapped object, which does all the work     */    private SVNClient worker;    /**     * our class, we synchronize on that.     */    static private Class clazz = SVNClientSynchronized.class;    /**     * Create our worker     */    public SVNClientSynchronized()    {        synchronized(clazz)        {            worker = new SVNClient();        }    }    /**     * release the native peer (should not depend on finalize)     */    public void dispose()    {        worker.dispose();    }    /**     * @return Version information about the underlying native libraries.     */    public Version getVersion()    {        synchronized(clazz)        {            return worker.getVersion();        }    }    /**     * @return The name of the working copy's administrative     * directory, which is usually <code>.svn</code>.     * @see <a     * href="http://svn.collab.net/repos/svn/trunk/notes/asp-dot-net-hack.txt">Instructions</a>     * on changing this as a work-around for the behavior of ASP.Net     * on Windows.     * @since 1.3     */    public String getAdminDirectoryName()    {        synchronized(clazz)        {            return worker.getAdminDirectoryName();        }    }    /**     * @param name The name of the directory to compare.     * @return Whether <code>name</code> is that of a working copy     * administrative directory.     * @since 1.3     */    public boolean isAdminDirectory(String name)    {        synchronized(clazz)        {            return worker.isAdminDirectory(name);        }    }    /**     * Returns the last destination path submitted.     * @deprecated     * @return path in Subversion format.     */    public String getLastPath()    {        synchronized(clazz)        {            return worker.getLastPath();        }    }    /**     * List a directory or file of the working copy.     *     * @param path      Path to explore.     * @param descend   Recurse into subdirectories if they exist.     * @param onServer  Request status information from server.     * @param getAll    get status for uninteristing files (unchanged).     * @return Array of Status entries.     */    public Status[] status(String path, boolean descend, boolean onServer,                           boolean getAll) throws ClientException    {        synchronized(clazz)        {            return worker.status(path, descend, onServer, getAll);        }    }    /**     * List a directory or file of the working copy.     *     * @param path      Path to explore.     * @param descend   Recurse into subdirectories if they exist.     * @param onServer  Request status information from server.     * @param getAll    get status for uninteristing files (unchanged).     * @param noIgnore  get status for normaly ignored files and directories.     * @return Array of Status entries.     */    public Status[] status(String path, boolean descend, boolean onServer,                           boolean getAll, boolean noIgnore)            throws ClientException    {        synchronized(clazz)        {            return worker.status(path, descend, onServer, getAll, noIgnore);        }    }    /**     * List a directory or file of the working copy.     *     * @param path            Path to explore.     * @param descend         Recurse into subdirectories if they exist.     * @param onServer        Request status information from server.     * @param getAll          get status for uninteristing files (unchanged).     * @param noIgnore        get status for normaly ignored files and     *                        directories.     * @param ignoreExternals if externals are ignored during checkout     * @return Array of Status entries.     * @since 1.2     */    public Status[] status(String path, boolean descend, boolean onServer,                           boolean getAll, boolean noIgnore,                           boolean ignoreExternals) throws ClientException    {        synchronized(clazz)        {            return worker.status(path, descend, onServer, getAll, noIgnore,                    ignoreExternals);        }    }    /**     * Lists the directory entries of an url on the server.     * @param url       the url to list     * @param revision  the revision to list     * @param recurse   recurse into subdirectories     * @return  Array of DirEntry objects.     */    public DirEntry[] list(String url, Revision revision, boolean recurse)            throws ClientException    {        synchronized(clazz)        {            return worker.list(url, revision, recurse);        }    }    /**     * Lists the directory entries of an url on the server.     *     * @param url         the url to list     * @param revision    the revision to list     * @param pegRevision the revision to interpret url     * @param recurse     recurse into subdirectories     * @return Array of DirEntry objects.     * @since 1.2     */    public DirEntry[] list(String url, Revision revision, Revision pegRevision,                           boolean recurse) throws ClientException    {        synchronized(clazz)        {            return worker.list(url, revision, pegRevision, recurse);        }    }    /**     * Returns the status of a single file in the path.     *     * @param path      File to gather status.     * @param onServer  Request status information from the server.     * @return  the subversion status of the file.     */    public Status singleStatus(String path, boolean onServer)             throws ClientException    {        synchronized(clazz)        {            return worker.singleStatus(path, onServer);        }    }    /**     * Sets the username used for authentification.     * @param username  the username     */    public void username(String username)    {        synchronized(clazz)        {            worker.username(username);        }    }    /**     * Sets the password used for authification.     * @param password  the password     */    public void password(String password)    {        synchronized(clazz)        {            worker.password(password);        }    }    /**     * Register callback interface to supply username and password on demand     * @param prompt the callback interface     */    public void setPrompt(PromptUserPassword prompt)    {        synchronized(clazz)        {            worker.setPrompt(prompt);        }    }    /**     * Retrieve the log messages for an item     * @param path          path or url to get the log message for.     * @param revisionStart first revision to show     * @param revisionEnd   last revision to show     * @return array of LogMessages     */    public LogMessage[] logMessages(String path, Revision revisionStart,                                    Revision revisionEnd) throws ClientException    {        synchronized(clazz)        {            return worker.logMessages(path, revisionStart, revisionEnd, true,                    false);        }    }    /**     * Retrieve the log messages for an item     * @param path          path or url to get the log message for.     * @param revisionStart first revision to show     * @param revisionEnd   last revision to show     * @param stopOnCopy    do not continue on copy operations     * @return array of LogMessages     */    public LogMessage[] logMessages(String path, Revision revisionStart,                                    Revision revisionEnd, boolean stopOnCopy)            throws ClientException    {        synchronized(clazz)        {            return worker.logMessages(path, revisionStart, revisionEnd,                    stopOnCopy, false);        }    }    /**     * Retrieve the log messages for an item     * @param path          path or url to get the log message for.     * @param revisionStart first revision to show     * @param revisionEnd   last revision to show     * @param stopOnCopy    do not continue on copy operations     * @param discoverPath  returns the paths of the changed items in the     *                      returned objects     * @return array of LogMessages     */    public LogMessage[] logMessages(String path, Revision revisionStart,                                    Revision revisionEnd, boolean stopOnCopy,                                    boolean discoverPath)            throws ClientException    {        synchronized(clazz)        {            return worker.logMessages(path, revisionStart, revisionEnd,                    stopOnCopy, discoverPath);        }    }    /**     * Retrieve the log messages for an item     * @param path          path or url to get the log message for.     * @param revisionStart first revision to show     * @param revisionEnd   last revision to show     * @param stopOnCopy    do not continue on copy operations     * @param discoverPath  returns the paths of the changed items in the     *                      returned objects     * @param limit         limit the number of log messages (if 0 or less no     *                      limit)     * @return array of LogMessages     * @since 1.2     */    public LogMessage[] logMessages(String path, Revision revisionStart,                                    Revision revisionEnd, boolean stopOnCopy,                                    boolean discoverPath, long limit)            throws ClientException    {        return worker.logMessages(path, revisionStart, revisionEnd,                stopOnCopy, discoverPath, limit);    }    /**     * Executes a revision checkout.     * @param moduleName name of the module to checkout.     * @param destPath destination directory for checkout.     * @param revision the revision to checkout.     * @param pegRevision the peg revision to interpret the path     * @param recurse whether you want it to checkout files recursively.     * @param ignoreExternals if externals are ignored during checkout     * @exception ClientException     * @since 1.2     */    public long checkout(String moduleName, String destPath, Revision revision,                         Revision pegRevision, boolean recurse,                         boolean ignoreExternals)            throws ClientException    {        synchronized(clazz)        {            return worker.checkout(moduleName, destPath, revision, pegRevision,                    recurse, ignoreExternals);        }    }    /**     * Executes a revision checkout.     * @param moduleName name of the module to checkout.     * @param destPath destination directory for checkout.     * @param revision the revision to checkout.     * @param recurse whether you want it to checkout files recursively.     * @exception ClientException     */    public long checkout(String moduleName, String destPath, Revision revision,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -