*******************************
Dynamsoft SAW Standalone Java Command Line Overview
*******************************
In addition to the Java GUI Client, Dynamsoft SAW Standalone also provides a
Java Command Line Client. Dynamsoft SAW Standalone Java Command Line supports all the major
operations required for source control.
To access Dynamsoft SAW Standalone Java Command Line, use the command prompt. You must use the
command line by changing your current folder to the folder where SAWSCmd.jar
resides.
Note: Dynamsoft SAW Standalone Java Command Line Client works with Dynamsoft SAW Standalone Professional
Server
only.
********************
Command Line Syntax
********************
All Dynamsoft SAW Standalone commands entered from the Java command line must begin with "java -jar
SAWSCmd.jar".
The syntax for Dynamsoft SAW Standalone commands is as follows:
java -jar SAWSCmd.jar Command [parameter(s)][value(s)]
<Command>
A specific instruction to perform an operation or run a program.
The commands in Dynamsoft SAW Standalone are not case-sensitive.
For a complete list of commands in Dynamsoft SAW Standalone Command Line, see
Commands and
Parameters.
<Parameter>
Used to modify the action of a command. The parameters in Dynamsoft SAW Standalone consist of a hyphen ( - ) and a letter.
For a complete list of parameters in Dynamsoft SAW Standalone Command Line, see
Commands and
Parameters.
<Values>
Can be a project or a file. The value must follow the parameter letter
with a space between them.
If there is a space in any command parameter value, the value must be
surrounded
by double quotes. For example:
java -jar SAWSCmd.jar GetFileInfo -server 127.0.0.1 -port 8877 -username test
-pwd
test -tempdir D:\temp -repository "Dynamsoft SAW Standalone" -prj $/123 -file "Text 1.txt"
In almost all cases where you can specify an item to act on, you can also
specify
many items by adding "/" between them. For example:
java -jar SAWSCmd.jar AddFile -server 127.0.0.1 -port 8877 -username test -pwd
test
-tempdir D:\temp -repository "Dynamsoft SAW Standalone" -prj $/123 -file Hello.txt/Test.txt
*************************************
Commands and Parameters
*************************************
<Commands>
The following is a list and general description of all the command-line commands.
|
Command |
Description |
| About | Displays the version information.
Required Params: -server, -port, -username, -pwd |
| AddFile | Adds one or multiple files to a project. The
path of the file on the local machine is specified by the -workdir
parameter. Required Params: -server, -port, -username, -pwd, -repository, -prj, -file, -workdir Optional Params: -tempdir, -comment, -auto or -mergable or -bin, -notreadonly, -windows or -unix or -mac, -ptype, -pserver, -pport, -puser, -ppwd |
| AddFolder | Adds an entire local folder to the database.
The path of the folder on the local machine is specified by the -workdir
parameter. Use -r to add the folder recursively. Required Params: -server, -port, -username, -pwd, -repository, -prj, -workdir Optional Params: -tempdir, -comment, -r, -auto or -mergable or -bin, -windows or -unix or -mac, -notreadonly, -ptype, -pserver, -pport, -puser, -ppwd |
| AddLabel | Adds a label to a project or a file.
Required Params: -server, -port, -username, -pwd, -repository, -prj,
-label |
| BranchFile | Breaks the share link so that the changes made
to that file will no longer be reflected in other projects. Required Params: -server, -port, -username, -pwd, -repository, -prj, -file Optional Params: -comment, -tempdir, -ptype, -pserver, -pport, -puser, -ppwd |
| CheckInFile | Checks in and unlocks one or multiple files.
This command also makes the local files read-only. Required Params: -server, -port, -username, -pwd, -repository, -prj, -file Optional Params: -workdir, -comment, -keep, -windows or -unix or -mac, -checkin or -ask or -undo, -del, -notreadonly, -tempdir, -ptype, -pserver, -pport, -puser, -ppwd |
| CheckInProject | Checks in and unlocks an entire project. This
command also makes the local files in the project read-only. Use -r to check
in the project recursively. Required Params: -server, -port, -username, -pwd, -repository, -prj Optional Params: -workdir, -r, -comment, -keep, -del, -windows or -unix or -mac, -checkin or -ask or -undo, -notreadonly, -tempdir, -ptype, -pserver, -pport, -puser, -ppwd |
| CheckOutFile | Checks out and locks one or multiple files in
the same project. This command also makes the local files writable. Required Params: -server, -port, -username, -pwd, -repository, -prj, -file Optional Params: -workdir, -tempdir, -cancel or -ask or -skip or -replace,-windows or -unix or -mac, -time, -comment, -ptype, -pserver, -pport, -puser, -ppwd |
| CheckOutProject | Checks out and locks an entire project. This
command also makes the local files in the project writable. Use -r to
checkout a project recursively. Required Params: -server, -port, -username, -pwd, -repository, -prj Optional Params: -workdir, -tempdir, -r, -cancel or -ask or -skip or -replace,-windows or -unix or -mac, -time, -comment, -ptype, -pserver, -pport, -puser, -ppwd |
| CreateProject | Creates an empty project in the current
repository. Use -prj to specify the project path and name. Required Params: -server, -port, -username, -pwd, -repository, -prj Optional Params: -comment, -ptype, -pserver, -pport, -puser, -ppwd |
| Delete | Deletes a file or project from the repository,
while local files still exist on the computer. If the -permanent flag is
set, the deleted items cannot be recovered. Required Params: -server, -port, -username, -pwd, -repository, -prj Optional Params: -file, -permanent, -ptype, -pserver, -pport, -puser, -ppwd |
| GetAllRepositories | Lists all accessible repositories by the input
server.
Required Params: -server, -port |
| GetAllUsers | Lists all active users in the current
repository.
Required Params: -server, -port, -username, -pwd, -repository |
| GetFileHistory | Displays the revision history of the file. Required Params: -server, -port, -username, -pwd, -repository, -prj, -file Optional Params: -user, -datetime, -ptype, -pserver, -pport, -puser, -ppwd |
| GetFileInfo | Displays the current information about a file,
including type, version number and modified date. Required Params: -server, -port, -username, -pwd, -repository, -prj, -file Optional Params: -ptype, -pserver, -pport, -puser, -ppwd |
| GetFileList | Lists the full name of all files in the
specified project. Required Params: -server, -port, -username, -pwd, -repository, -prj Optional Params: -ptype, -pserver, -pport, -puser, -ppwd |
| GetLatestFiles | Retrieve the most recent files from the current
repository. Required Params: -server, -port, -username, -pwd, -repository, -prj, -file Optional Params: -workdir, -tempdir, -writable, -cancel or -ask or -skip or -replace,-time,-windows or -unix or -mac, -ptype, -pserver, -pport, -puser, -ppwd |
| GetOldVersionFile | Retrieve an old file version from the current
repository. The -rev parameter is used to specify an old file version. Required Params: -server, -port, -username, -pwd, -repository, -prj, -file Optional Params: -rev, -workdir, -tempdir, -writable, -cancel or -ask or -skip or -replace,-time,-windows or -unix or -mac, -ptype, -pserver, -pport, -puser, -ppwd |
| GetProject | Gets the latest version of all files in the
specified project from the current repository. Use -r to get the project
recursively.
Required Params: -server, -port, -username, -pwd, -repository, -prj |
| GetProjectHistory | Displays the revision history of the project. If
the -v flag is set, the histories will be shown by version, or it will be
shown by item.
Required Params: -server, -port, -username, -pwd, -repository, -prj |
| GetProjectTree | Graphically displays the project structure. Required Params: -server, -port, -username, -pwd, -repository, -prj Optional Params: -ptype, -pserver, -pport, -puser, -ppwd |
| Interactive | Puts the Client in an interactive shell, where
you can enter commands one after the other, without having to re-run the
Command Line Client each time. Type 'quit' when you want to quit interactive
shell.
Required Params: -server, -port, -username, -pwd, -repository |
| PinFile | Locks a file or project to a specified version
number. Once an item is pinned, no changes can be made to it and the pinned
version becomes the current version of the item.
Required Params: -server, -port, -username, -pwd, -repository, -prj,
-file |
| Rename | Renames a file or project in the current
repository. Required Params: -server, -port, -username, -pwd, -repository, -prj, -newname Optional Params: -ptype, -pserver, -pport, -puser, -ppwd, -file |
| SetFileType | Sets the type of the file.
Required Params: -prj, -file, -mergable or -bin |
| ShareFile | Shares the current version of one or multiple
files to another project. Updates to a shared file will be reflected in all
the projects to which the file is shared. Required Params: -server, -port, -username, -pwd, -repository, -prj, -file, -shareto Optional Params: -branch, -comment, -ptype, -pserver, -pport, -puser, -ppwd |
| ShareProject | Shares the current version of a project to
another project. Updates to files in a shared project will be reflected in
all the projects to which the project is shared. Required Params: -server, -port, -username, -pwd, -repository, -prj, -shareto Optional Params: -branch, -r, -comment, -newname, -ptype, -pserver, -pport, -puser, -ppwd |
| UndoCheckOutFile | Cancels the checkout of one or multiple files
and reverts to the state before the Check Out operation was performed. This
command also makes the local files read-only. Required Params: -server, -port, -username, -pwd, -repository, -prj, -file Optional Params: -workdir, -tempdir, -windows or -unix or -mac, -time, -leave or -replace or -del, -notreadonly, -ptype, -pserver, -pport, -puser, -ppwd |
| UndoCheckOutProject | Cancels the checkout of a project and reverts
to the state before the Check Out operation was performed. This command also
makes the local files read-only. Use -r to undo checkout of the project
recursively. Required Params: -server, -port, -username, -pwd, -repository, -prj Optional Params: -workdir, -tempdir, -r,-windows or -unix or -mac,-time, -leave or -replace or -del,-notreadonly, -ptype, -pserver, -pport, -puser, -ppwd |
| UnPinFile | Cancels the Pin operation, ignoring the files
that are not pinned.
Required Params: -server, -port, -username, -pwd, -repository, -prj,
-file |
<Parameters>
The following is a list and description of parameters accepted by Dynamsoft SAW Standalone Java
Command
Line. It is necessary to enter full parameter names. If you want to cancel
current
operation, type 'c' and then press Enter.
Note: Please put a space between a parameter and the value it acts on.
|
Parameter |
Description |
| -ask | Prompts on how to handle the local file copies .
Used with CheckInFile, CheckInProject, CheckOutFile, CheckOutProject, GetLatestFiles, GetOldVersionFile, and GetProject commands. |
| -auto | Auto detects the file type.
Used with AddFile and AddFolder commands. |
| -bin | Sets the file type to be binary.
Used with AddFile, AddFolder and SetFileType commands. |
| -branch | Performs a branch operation immediately after the share
operation.
Used with ShareFile and ShareProject commands. |
| -checkin | Updates the unchanged item to a new version.
Used with CheckInFile and CheckInProject commands. |
| -comment | Comments on the corresponding operations with text.
Used with the following commands: AddFile, AddFolder, AddLabel, BranchFile, CheckInFile, CheckInProject, CheckOutFile, CheckOutProject, CreateProject, ShareFile, ShareProject. |
| -datetime | Specifies a period of time. By default it's from the current
time to one year ago. You can type two value in the format "datefrom|dateto",
or just one value as the ending date/time of period which begins from the
current time .
Acceptable date/time formats: Used with GetFileHistory, GetProjectHistory and GetProject commands. |
| -del | Deletes the local copy.
Used with CheckInFile, CheckInProject, UndoCheckOutFile, and UndoCheckOutProject commands. |
| -file | Specifies the name of the file(s) in the repository or the
absolute path and full name of the local file(s).
Used with the following commands: AddFile, AddLabel, BranchFile, CheckInFile, CheckOutFile, GetLatestFiles, GetOldVersionFile, GetFileHistory, GetFileInfo, Delete, Rename, SetFileType, ShareFile, UndoCheckOutFile, Pin, and Unpin. |
| -h /-? | Displays help at the command prompt.
Available for all commands. |
| -keep | Keeps checkout status after the check-in operation.
Used with CheckInFile and CheckInProject commands. |
| -label | Specifies a label that can be associated with a particular
project version or file version.
Used with AddLabel and GetProject command. |
| -leave | Leaves the local copy alone.
Used with UndoCheckOutFile and UndoCheckOutProject commands. |
| -mac | Uses Mac EOL for files.
Used with the following commands: AddFile, AddFolder, CheckInFile, CheckInProject, CheckOutFile, CheckOutProject, GetLatestFiles, GetOldVersionFile, GetProject, UndoCheckOutFile, UndoCheckOutProject. |
| -mergable | Sets the file type to be mergable.
Used with AddFile, AddFolder and SetFileType commands. |
| -newname | Specifies a new name for the project or file that is being
renamed.
Used with the Rename command. |
| -notreadonly | Doesn't change the file attribute to read-only.
Used with the following commands: AddFile, AddFolder, CheckInProject, CheckInFile, UndoCheckOutProject and UndoCheckOutFile. |
| -permanent | Permanently deletes a file or project from the database.
Used with the Delete command. |
| -port | Specifies the port of a running Dynamsoft SAW Standalone server or
cache server.
A must for all commands. |
| -pport | Specifies the port of the proxy server.
Needed when the proxy server is used. |
| -ppwd | Specifies the password for the corresponding user to connect
to the proxy server.
Needed when the proxy server is used. |
| -prj | Specifies a valid project in the current Dynamsoft SAW Standalone
repository.
A must for all commands except About, GetAllRepositoties, GetAllUsers and Interactive. |
| -pserver | Specifies the domain name or IP address of the proxy server.
If ptype = "None", this parameter is invalid and not required.
Needed when the proxy server is used. |
| -ptype | Specifies the proxy type. Valid -ptype parameters are
"None", "Http", "Socks4" and "Socks5", the default value is "None".
Needed when the proxy server is used. |
| -puser | Specifies the user name used to connect to the proxy server.
If ptype = "None" or "Socks4", this parameter is invalid and not required.
Needed when the proxy server is used. |
| -pwd | Specifies the password for the corresponding user to log
into Dynamsoft SAW Standalone repository.
A must for all commands except GetAllRepositories. |
| -r | Performs the project level command recursively.
Used with the following commands: AddFolder, CheckInProject, CheckOutProject, GetProject, ShareProject and UncoCheckOutProject. |
| -replace | Replaces the local copy with file(s) in the repository.
Used with the following commands: CheckOutFile, CheckOutProject, GetLatestFiles, GetOldVersionFile, GetProject, UndoCheckOutFile and UndoCheckOutProject. |
| -repository | Specifies the repository you want to log into.
A must for all commands except GetAllRepositories. |
| -rev | Specifies a version number of the file.
Used with GetOldVersionFile and Pin commands. |
| -skip | Leaves the local copy alone (doesn't retrieve the latest
version from the repository).
Used with the following commands: CheckOutFile, CheckOutProject, GetLatestFiles, GetOldVersionFile, and GetProject. |
| -server | Specifies the domain name or IP address of a running Dynamsoft SAW Standalone server or cache server.
A must for all commands. |
| -shareto | Specifies the project into which a file or project will be
shared.
Used with ShareFile and ShareProject commands. |
| -tempdir | Specifies a local folder for storing temporary files. For Java Command Line, the
default temporary directory is the system temporary directory.
Used with the following commands: AddFile, AddFolder, CheckInFile, CheckInProject, CheckOutFile, CheckOutProject, GetLatestFiles, GetOldVersionFile, GetProject, UndoCheckOutFile, and UndoCheckOutProject. |
| -time | Sets the modification time of the local file or project.
Valid time parameters are "current" (default), "modi" and "checkin". modi - The item's last modified time. current - Current time. checkin- The item's last checked in time. Examples: -time modi or -time current or -time checkin. Used with the following commands: CheckOutFile, CheckOutProject, GetLatestFiles, GetOldVersionFile, GetProject, UndoCheckOutFile, and UndoCheckOutProject. |
| -undo | Undoes the checkout without updating to a new version.
Used with CheckInFile and CheckInProject commands. |
| -unix | Uses Unix EOL for files.
Used with the following commands: AddFile, AddFolder, CheckInFile, CheckInProject, CheckOutFile, CheckOutProject, GetLatestFiles, GetOldVersionFile, GetProject, UndoCheckOutFile, and UndoCheckOutProject. |
| -user | Specifies an existing username.
Used with GetFileHistory and GetProjectHistory commands. |
| -username | Specifies the user name used to log into Dynamsoft SAW Standalone
repository.
A must for all commands except GetAllRepositories. |
| -v | Shows the project histories by version.
Used with the GetProjectHistory command. |
| -windows | Uses Windows EOL for files.
Used with the following commands: AddFile, AddFolder, CheckInFile, CheckInProject, CheckOutFile, CheckOutProject, GetLatestFiles, GetOldVersionFile, GetProject, UndoCheckOutFile, and UndoCheckOutProject. |
| -writable | Makes the local files writable.
Used with GetLatestFiles, GetOldVersionFile, GetProject. |
| -workdir | Specifies the working folder from which the Command Line
Client finds or places items. By default it's Dynamsoft SAW Standalone Command
Line directory.
Used with the following commands: AddFile, AddFolder, CheckInFile, CheckInProject, CheckOutFile, CheckOutProject, GetLatestFiles, GetOldVersionFile, GetProject, UndoCheckOutFile, and UndoCheckOutProject. |
*******************
Examples
*******************
All examples in this section are based on the following assumptions:
Dynamsoft SAW Standalone Server IP = 127.0.0.1
Dynamsoft SAW Standalone Server Port = 8877
Dynamsoft SAW Standalone Server username = test
Dynamsoft SAW Standalone Server password = test
Dynamsoft SAW Standalone Repository = Dynamsoft SAW Standalone
Project = $/123
Temp folder = "D:\temp"
Working folder = "c:\projects\test"
Example 1: Add a project to the database
----------------------------------------
This adds an entire project located at "c:\projects\new" on the local machine to
the
project "$/123" in Dynamsoft SAW Standalone repository.
java -jar SAWSCmd.jar AddFolder -server 127.0.0.1 -port 8877 -username test -pwd
test
-repository "Dynamsoft SAW Standalone" -workdir c:\projects\new -prj $/123/new -tempdir D:\temp
Example 2: Add a file to project
----------------------------------------
This adds a file "test.txt" to "$/123" project.
java -jar SAWSCmd.jar AddFile -server 127.0.0.1 -port 8877 -username test -pwd
test
-repository "Dynamsoft SAW Standalone" -workdir "c:\projects\test" -file "test.txt" -prj $/123 -tempdir
"D:\temp"
Example 3: Get a file
---------------------
This places the latest version of the file "test.txt" into the working folder.
java -jar SAWSCmd.jar GetLatestFiles -server 127.0.0.1 -port 8877 -username test -pwd
test
-repository "Dynamsoft SAW Standalone" -workdir c:\projects\test -prj $/123 -file text.txt -tempdir D:\temp
Example 4: Get file list
------------------------------
This gets the list of files in the "$/123" project.
java -jar SAWSCmd.jar GetFileList -server 127.0.0.1 -port 8877 -username test
-pwd
test -repository "Dynamsoft SAW Standalone" -prj $/123 -tempdir D:\temp
Example 5: Check in a file
---------------------------
This checks in the previously checked out file "test.txt", located on the
working
folder at "c:\projects\test".
java -jar SAWSCmd.jar CheckInFile -server 127.0.0.1 -port 8877 -username test
-pwd
test -repository "Dynamsoft SAW Standalone" -workdir c:\projects\test -prj $/123 -file test.txt -tempdir
D:\temp
-comment "Added function HelloWorld"
Example 6: Check out a file
---------------------------
This checks out the latest version of the file "test.txt" and places it into the
working folder.
java -jar SAWSCmd.jar CheckOutFile -server 127.0.0.1 -port 8877 -username test
-pwd
test -repository "Dynamsoft SAW Standalone" -workdir c:\projects\test -prj $/123 -file test.txt -tempdir
D:\temp
Example 7: Label a project
--------------------------
This applies the label "Version 3" to project "$/123" in Dynamsoft SAW Standalone repository.
java -jar SAWSCmd.jar AddLabel -server 127.0.0.1 -port 8877 -username test -pwd
test
-repository "Dynamsoft SAW Standalone" -prj $/123 -label "Version 3"
Example 8: Retrieve all files in a project tree by a label
----------------------------------------------------------
This gets a previous version of a project from a label. It retrieves all of the
files in the project associated with that label, placing them in the directory
specified by -workdir. It will create directories as needed.
java -jar SAWSCmd.jar GetProject -server 127.0.0.1 -port 8877 -username test -pwd
test -repository "Dynamsoft SAW Standalone" -workdir c:\projects\test -prj $/123 -label "version 1" -tempdir
D:\temp
Example 9: Share a project with another project
-----------------------------------------------
This shares the current version of the project "$/123" with the project
"$/projects/Dynamsoft SAW Standalone" in Dynamsoft SAW Standalone repository.
java -jar SAWSCmd.jar ShareProject -server 127.0.0.1 -port 8877 -username test
-pwd
test -repository "Dynamsoft SAW Standalone" -prj $/123 -shareto $/projects/Dynamsoft SAW Standalone -comment "Sharing project 123
into project Dynamsoft SAW Standalone"
Example 10: Branch a shared file
----------------------------------
This branches files "test.txt" which was previously shared with another files in
Dynamsoft SAW Standalone repository.
java -jar SAWSCmd.jar BranchFile -server 127.0.0.1 -port 8877 -username test -pwd
test -repository "Dynamsoft SAW Standalone" -prj $/123 -file test.txt
Example 11: Delete a project permanently
----------------------------------------
This deletes project "$/123" permanently from Dynamsoft SAW Standalone
repository.
java -jar SAWSCmd.jar Delete -server 127.0.0.1 -port 8877 -username test -pwd
test
-repository "Dynamsoft SAW Standalone" -prj $/123 -permanent
Example 12: Put the Command Line Client in an interactive shell
----------------------------------------
This puts the Command Line Client in an interactive shell.
java -jar SAWSCmd.jar Interactive -server 127.0.0.1 -port 8877 -username test
-pwd
test -repository "Dynamsoft SAW Standalone" -tempdir D:\Temp
Example 13: Add a file to project in an interactive shell
----------------------------------------
This adds a file to project in an interactive shell.
AddFile -file "test.txt" -prj $/123
**************
Encryption
**************
To enable the Java Command Line Client to connect to the secure port and use
encryption, Dynamsoft SAW Standalone Java Client must be installed on the same
machine.
The Java Command Line Client will use the same User Key that has been imported
into
the Java Client to authenticate the secure connection.
The Java Command Line Client will use encryption or not depending on the port
that
it connects to. Please contact your Dynamsoft SAW Standalone Administrator to find out which ports
are
being used for secure and unsecure connections.