Dynamsoft Home| Product Home

*******************************
Dynamsoft SAW for VSS Java Command Line Overview
*******************************

In addition to the Explorer Client for Dynamsoft SourceAnywhere for VSS, Dynamsoft SourceAnywhere for VSS provides a
Java Command Line Client. The Dynamsoft SAW for VSS Java Command Line supports all the major
operations required for source control.

To access the Dynamsoft SAW for VSS Java Command Line, use the command prompt. You must use the
command line by changing your current folder to the folder where SAWVVcmd.jar resides.

Note: the Dynamsoft SAW for VSS Java Command Line Client works with Dynamsoft SourceAnywhere for VSS Professional Server
only.



********************
Command Line Syntax
********************

All Dynamsoft SAW for VSS commands entered from the Java command line must begin with "java -jar
SAWVVcmd.jar".

The syntax for Dynamsoft SAW for VSS commands is as follows:

java -jar SAWVVcmd.jar Command [parameter(s)][value(s)]


<Commands>

The commands are not case-sensitive. The commands can be either uppercase or
lowercase.

For a complete list of commands in Dynamsoft SAW for VSS Command Line, see Commands and Parameters.

<Parameters>

Parameters you use to modify the action of a command. They consist of a hyphen ( - )
and a letter.

For a complete list of parameters in Dynamsoft SAW for VSS Command Line, see Commands and Parameters.

<Values>

The value can be a project or a file. The value must follow the parameter letter
with a space between them.

If there is any space in any command parameter value, the value must be surrounded
by double quotes. For example:

java -jar SAWVVcmd.jar GetFileInfo -server 127.0.0.1 -port 8877 -username test -pwd
test -tempdir D:\temp -alias vss -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 SAWVVcmd.jar AddFile -server 127.0.0.1 -port 8877 -username test -pwd test
-tempdir D:\temp -alias vss -prj $/123 -file Hello.txt/Test.txt



*************************************
Command Line Commands and Parameters
*************************************

<Commands>

The following is a list and general description of all the command-line commands.

1. About

Displays the version information.

2. 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, -alias, -prj, -file,-workdir
Optional Params: -tempdir, -comment, -auto or -text or -bin,-zoneoff,
-notreadonly, -ptype, -pserver, -pport, -puser, -ppwd, -nozip, -nodelta

3. AddFolder

Adds an entire local folder to the database. The path of the local folder on the
local machine is specified by the -workdir parameter. Use -r to add the folder
recursively.

Required Params: -server, -port, -username, -pwd, -alias, -prj, -workdir
Optional Params: -nozip, -nodelta, -tempdir, -comment, -r, -auto or -text or
-bin,-zoneoff, -notreadonly, -ptype, -pserver, -pport, -puser, -ppwd, -nozip,
-nodelta

4. AddLabel

Adds a label to a project or a file.

Required Params: -server, -port, -username, -pwd, -alias, -prj, -label
Optional Params: -comment, -file, -ptype, -pserver, -pport, -puser, -ppwd

5. BranchFile

Breaks the share link and the changes made to that file will no longer be reflected
in other projects.

Required Params: -server, -port, -username, -pwd, -alias, -prj, -file
Optional Params: -comment, -ptype, -pserver, -pport, -puser, -ppwd

6. CreateProject

Creates an empty project in the VSS database whose full name is specified by the
-prj parameter.

Required Params: -server, -port, -username, -pwd, -alias, -prj
Optional Params: -comment, -ptype, -pserver, -pport, -puser, -ppwd

7. CheckInFile

Checks in one or multiple files.

Required Params: -server, -port, -username, -pwd, -alias, -prj, -file
Optional Params: -workdir, -tempdir, -comment,-keep,-windows or -unix or -mac,-
checkin or -ask or -undo, -del, -zoneoff, -notreadonly, -ptype, -pserver, -pport,
-puser, -ppwd, -nozip, -nodelta

8. CheckInProject

Checks in an entire project. Use -r to check in the project recursively.

Required Params: -server, -port, -username, -pwd, -alias, -prj
Optional Params: -workdir, -tempdir, -r, -comment,-del, -windows or -unix or -mac,
-keep, -checkin or -ask or -undo, -zoneoff, -notreadonly, -ptype, -pserver, -pport,
-puser, -ppwd, -nozip, -nodelta

9. CheckOutFile

Checks out one or multiple files. This command also makes the local files writable.

Required Params: -server, -port, -username, -pwd, -alias, -prj, -file
Optional Params: -workdir, -tempdir, -ask or -skip or -replace,-windows or -unix or
-mac,-time, -zoneoff, -ptype, -pserver, -pport, -puser, -ppwd, -nozip, -nodelta

10. CheckOutProject

Checks out 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, -alias, -prj
Optional Params: -workdir, -tempdir, -r ,-ask or -skip or -replace,-windows or -unix
or -mac,-time,-zoneoff, -ptype, -pserver, -pport, -puser, -ppwd, -nozip, -nodelta

11. Delete

Deletes a file or project. If the -permanent flag is set, it will delete the file or
project permanently from the database so it cannot be recovered.

Required Params: -server, -port, -username, -pwd, -alias, -prj
Optional Params: -file, -permanent, -ptype, -pserver, -pport, -puser, -ppwd

12.Dir

Displays all projects and files under a project. Use -r to see about a project recursively.

Required Params: -prj
Optinal Params: -r, -zoneoff

13. GetDatabases

Lists all databases accessible by the input server.

Required Params: -server, -port
Optional Params: -ptype, -pserver, -pport, -puser, -ppwd

14. GetFile

Gets one or multiple files from the SourceSafe database. It will get the latest
version of files unless the -rev parameter is used to specify a previous file
version.

Required Params: -server, -port, -username, -pwd, -alias, -prj, -file
Optional Params: -workdir, -tempdir, -rev ,-writable, -ask or -skip or
-replace,-time,-windows or -unix or -mac, -zoneoff, -ptype, -pserver, -pport,
-puser, -ppwd, -nozip, -nodelta

15. GetFileHistory

Gets the revision history of the file.

Required Params: -server, -port, -username, -pwd, -alias, -prj, -file
Optional Params: -user, -datetime, -zoneoff, -ptype, -pserver, -pport, -puser, -ppwd

16. GetFileInfo

Gets current information about a file.
Required Params: -server, -port, -username, -pwd, -alias, -prj, -file
Optional Params : -zoneoff, -ptype, -pserver, -pport, -puser, -ppwd

17. GetFileList

Gets a list of all files in the input project. This command outputs the name,
version and date of each file.

Required Params: -server, -port, -username, -pwd, -alias, -prj
Optional Params: -zoneoff, -ptype, -pserver, -pport, -puser, -ppwd

18. GetProject

Gets all of the files in a project. It will get the latest version of the files in a
project unless the -label or -datetime parameter is used to specify a previous
version of a project. Use -r to get the project recursively.

Required Params: -server, -port, -username, -pwd, -alias, -prj
Optional Params: -workdir, -tempdir, -datetime or -label , -r, -writable, -time ,
-ask or -skip or -replace, -windows or -unix or -mac, -zoneoff, -ptype, -pserver,
-pport, -puser, -ppwd, -nozip, -nodelta

19. GetProjectHistory

Displays project history.


Required params: -prj
Optional params: -r,-user, -datatime, -zoneoff, -include filehistory

20. GetProjectTree

This command returns the structure of the project in the VSS database. Please note
that this command does not retrieve the files in the project.

Required Params: -server, -port, -username, -pwd, -alias, -prj
Optional Params: -ptype, -pserver, -pport, -puser, -ppwd

21. 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, -alias
Optional Params : -tempdir, -ptype, -pserver, -pport, -puser, -ppwd

22. Rename
Renames a file or project in the VSS database.

Required Params: -server, -port, -username, -pwd, -alias, -prj, -newname
Optional Params: -file, -ptype, -pserver, -pport, -puser, -ppwd

23. 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, -alias, -prj, -file, -shareto
Optional Params: -branch, -ptype, -pserver, -pport, -puser, -ppwd

24. 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, -alias, -prj, -shareto
Optional Params: -branch, -r, -comment, -ptype, -pserver, -pport, -puser, -ppwd

25. UndoCheckOutProject

Cancels the checkout of a project and revert to the state before the Check Out
operation was performed. Use -r to undo checkout of the project recursively.

Required Params: -server, -port, -username, -pwd, -alias, -prj
Optional Params: -workdir, -tempdir, -r,-windows or -unix or -mac,-time, -leave or
-replace or -del,-zoneoff, -notreadonly, -ptype, -pserver, -pport, -puser, -ppwd,
-nozip, -nodelta

26.UndoCheckOutFile

Cancels the checkout of one or multiple files and reverts to the state before the
Check Out operation was performed.

Required Params: -server, -port, -username, -pwd, -alias, -prj, -file
Optional Params: -workdir, -tempdir, -windows or -unix or -mac, -time, -leave or
-replace or -del, -zoneoff, -notreadonly, -ptype, -pserver, -pport, -puser, -ppwd,
-nozip, -nodelta


<Parameters>

The following is a list and description of parameters accepted by Dynamsoft SAW for VSS 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.

1. -alias

The alias that Dynamsoft SAW for VSS Server has defined to point to a SourceSafe database. This name
is specified under the Databases section of the Dynamsoft SAW for VSS Server Manager.

2. -ask

Used with GetFile, GetProject, CheckOutFile, CheckOutProject, CheckInFile and
CheckInProject. If present, will ask whether to perform skip or replace or cancel
operation.

3. -auto

Auto detect file type.

4. -bin

Binary file type.

5. -branch

Used with the ShareFile and ShareProject commands. If present, will perform a branch
operation immediately after the share.

6. -checkin

Check in the file.

7. -comment

Text used for comments.

8. -datetime

Used with the GetFileHistory or GetProject command.

When used with GetFileHistory:
A list of valid date, only required two value, the formats is "datefrom|dateto", the
first is date from, the second is date to. If -datetime is not present, query the
data from current time to one year ago.

When used with GetProject: only required one value.
The parameter can take a variety of formats. For example, the following strings
contain acceptable date/time formats:

"Jun/16/2005", "Jun/16/2005 6:10:00", "6/16/2005", "6/16/2005 6:10:00".

9. -del

Deletes local copy.

10. -file

A "/" separated list of valid Dynamsoft SAW for VSS files in the project specified by the -prj
parameter.

11. -h /-?

Help.

12. -keep

Used with CheckInFile and CheckInProject. If present, will keep checkout status
after the checkin.

13. -label
A label that can be associated with a particular project version or a file version.

14. -leave
Leaves local copy.

15. -mac
Mac EOL.

16. -newname
Used with the Rename command. The new name of a project or file that is being
renamed.

17. -nodelta
Turns off delta transfer. By default, the Command Line Client will use delta
transfer for all data transfers.

18. -notreadonly

Used with CheckInProject, CheckInFile, UndoCheckOutProject, UndoCheckOutFile,
AddFile and AddFolder. If present, will not changed the file attribute. If not
present ,will make file read-only.

19. -nozip

Turns off compression. By default, the Command Line Client will use compression for
all data transfers.

20. -permanent

Used with the Delete command. Permanently deletes a file or project from the
database.

21. -port

The port of a running Dynamsoft SAW for VSS server.

22. -pport

The port of the proxy server.

23. -ppwd

The password corresponding to the user name specified by the -puser parameter. See
also -puser.

24. -prj

A valid Dynamsoft SAW for VSS project in the database.

25. -pserver

The domain name or IP address of the proxy server. If ptype = "None", this parameter
is invalid and not required.

26. -ptype

The proxy type. Valid ptype parameters are "None", "Http", "Socks4" and "Socks5",
the default value is "None".

27. -puser

The user name used for connecting the proxy Server. If ptype = "None" or "Socks4",
the parameter is invalid and not required.

28. -pwd

The password corresponding to the user name specified by the -username parameter.

29. -r

If present, the project level command will be performed recursively.

30. -replace

Replace local copy or replace writable file.

31. -rev

A version number of the file specified.

32. -skip

Skip the local copy.

33. -server

The domain name or IP address of a running Dynamsoft SAW for VSS server.

34.-shareto

Used with the ShareFile and ShareProject commands. The project into which a file or
project will be shared.

35. -tempdir

Set the local temporary directory. The default temporary directory is the system
temporary directory.

36. -text

Text file type.

37. -time

Valid time parameters are "modi", "checkin" and "current". If -time is not present,
the current time is used.

modi - Specifies that the file's last modified date/time stamp will be the file's
modification time as set in the SourceSafe database.

current - Specifies that the current time will be used.

checkin- Specifies that the checked in time will be used.

Examples: -time modi or -time current or -time checkin.

38. -undo

Undo checking out.

39. -unix

Unix EOL.

40. -user

Used with GetFileHistory. If not specified, the history of all uses is returned.

41. -username

The user name used for logging into the Dynamsoft SAW for VSS Server.

42. -verb

If present, outputs verbose status messages, such as connections, server responses,
etc.

43. -windows

Windows EOL.

44. -writable

Used with GetFile and GetProject. If present, will make the files writable.

45. -workdir

The working directory where the Command Line Client places a Dynamsoft SAW for VSS file or project.
The default working directory is the Dynamsoft SAW for VSS Command Line directory. This parameter is
also used to specify where on the local machine the Command Line Client looks for a
file or project to add or check in to the database. The local working directory
should be an absolute path.

46. -zoneoff

Set the offset of server time zone to local time zone, the default is zero. The
value is between -24 and 24.

*******************
Examples
*******************

The following assumptions are made in these examples:

Dynamsoft SAW for VSS Server IP = 127.0.0.1
Dynamsoft SAW for VSS Server Port = 8877
Dynamsoft SAW for VSS Server username = test
Dynamsoft SAW for VSS Server password = test
SourceSafe database alias = vss
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 the VSS database.

java -jar SAWVVcmd.jar AddFolder -server 127.0.0.1 -port 8877 -username test -pwd test
-alias vss -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 SAWVVcmd.jar AddFile -server 127.0.0.1 -port 8877 -username test -pwd test
-alias vss -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 SAWVVcmd.jar GetFile -server 127.0.0.1 -port 8877 -username test -pwd test
-alias vss -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 SAWVVcmd.jar GetFileList -server 127.0.0.1 -port 8877 -username test -pwd
test -alias vss -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 SAWVVcmd.jar CheckInFile -server 127.0.0.1 -port 8877 -username test -pwd
test -alias vss -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 SAWVVcmd.jar CheckOutFile -server 127.0.0.1 -port 8877 -username test -pwd
test -alias vss -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 the VSS database.

java -jar SAWVVcmd.jar AddLabel -server 127.0.0.1 -port 8877 -username test -pwd test
-alias vss -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 SAWVVcmd.jar GetProject -server 127.0.0.1 -port 8877 -username test -pwd
test -alias vss -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/saw" in the VSS database.

java -jar SAWVVcmd.jar ShareProject -server 127.0.0.1 -port 8877 -username test -pwd
test -alias vss -prj $/123 -shareto $/projects/saw -comment "Sharing project 123
into project saw"

Example 10: Branch a shared file
----------------------------------
This branches files "test.txt" which was previously shared with another files in the
VSS database.

java -jar SAWVVcmd.jar BranchFile -server 127.0.0.1 -port 8877 -username test -pwd
test -alias vss -prj $/123 -file test.txt

Example 11: Delete a project permanently
----------------------------------------
This deletes project "$/123" permanently from the VSS database.

java -jar SAWVVcmd.jar Delete -server 127.0.0.1 -port 8877 -username test -pwd test
-alias vss -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 SAWVVcmd.jar Interactive -server 127.0.0.1 -port 8877 -username test -pwd
test -alias vss -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, the Dynamsoft SourceAnywhere for VSS 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 for VSS Administrator to find out which ports are
being used for secure and unsecure connections.