Class FCServerCLIWrapper


  • public class FCServerCLIWrapper
    extends java.lang.Object

    Title: FileCatalyst Direct Server API

    Description: Provides server-side command line to execute remote administrations calls to a FileCatalyst Server

    
     - - - - - - - - - - - - - - -
     COMMAND LINE USAGE:
     - - - - - - - - - - - - - - -
     
     
     See command-line help for complete usage:
      java -jar FCServerAPI.jar -help
     
    Multiple commands may be stacked left to right in one call.
    Usage:  java -jar FCServerAPI.jar [help commands] [connection directives] [command list]
    Help commands:  -help --> prints this help to console  -version --> prints out the Server API version  -disableStatusClient --> Forces status client to not run, and disables resynchronizations of config files. Speeds up ad-hoc user add/modify/delete commands. Commands requiring status client connection (session info) are disabled. Resynchronization calls may be executed manually and a command list.  -timeout --> Specify timeout for command to complete for CLI (return code 3 if timeout event occurs)
    Connection directives (if not found, default "localhost:12400" used.  -host --> location of the FileCatalyst Direct Server      [ip or hostname]      [ip or hostname]:[port]  -port --> location of the FileCatalyst Direct Server admin port, or HTTP port if using -lite.  -user --> Remote Server admin user      [username]      [username/password]  -passwd --> Remote Server admin password  -lite --> Use the lightweight admin. Requires remote admin and http to be enabled. The port must be the server's HTTP port.
    Command list:   -resynch --> forces the ServerAPI to resynch configuration files. Recommended use when disableStatusClient is set.   -getreqstr   -getlicstr   -setlicstr [license string]   -listusernames   -listalluserdetails   -killuser [username]   -killallusers   -listsessions   -killsession [sessionID]   -overridepriority [sessionID] [newpriority 0-10]   -overridebandwidthkbps [sessionID] [newbandwidth]   -resetalloverrides   -showrates   -adduser [username] [password]   -adduserandhome [username] [password] [directory]   -deluser [username]   -deluserandhome [username]   -enableuser [username] [true|false]   -modpasswd [username] [password]   -addtmppasswd [username] [password]   -deltmppasswd [username] [password]   -moduser [username] [[mod user subcommands]]     mod user subcommand list:     -muHomedir [directory]     -muEnable [true|false]     -muFullName [fullname]     -muEmail [email]     -muFileRead [true|false]     -muFileWrite [true|false]     -muFileModify [true|false]     -muFileDelete [true|false]     -muFileRename [true|false]     -muFolderRead [true|false]     -muFolderWrite [true|false]     -muFolderModify [true|false]     -muFolderDelete [true|false]     -muFolderRename [true|false]     -muPriority [1..10]     -muBandwidthLimit [kbps]     -muHasBandwidthLimit [true|false]     -muHasQuotaLimit [true|false]     -muDailyQuotaLimit [bytes]     -muExpiry [yyyy-MM-dd'T'HH:mm:ssz] --> eg: 2001-07-04T12:08:56PDT   -listGroups   -addGroup [groupname] [description] [true|false]   -enableGroup [groupname]   -delGroup [groupname]   -modGroup [groupname] [[mod group subcommands]]     -mgDescription [description]     -mgEnabled [true|false]   -listFolders --> returns unique folder name list   -listFoldersWithLabels --> returns folder name with labels in parenthesis ie: "storage_123(storage)"   -addFolder [label] [path] [description]   -delFolder [name]   -modFolder [groupname] [[mod folder subcommands]]     -mfDescription [description]     -mfLabel [label]     -mfPath [path]   -linkUserAndGroup [username] [groupname]");   -unlinkUserAndGroup [username] [groupname]");   -linkUserAndFolder [username] [foldername] [READ|READWRITE] --> if no permission, then it is set to No Access.");   -unlinkUserAndFolder [username] [groupname]");   -linkGroupAndFolder [groupname] [foldername] [READ|READWRITE] --> if no permission, then it is set to No Access.");");   -unlinkGroupAndFolder [username] [groupname]");   -listUsersLinkedToGroup [groupname]   -listGroupsLinkedToUser [username]   -getPermissionForFolderAndGroup [groupname] [foldername]
    Example 1: add user "bob" with a password "12345" java -jar FCServerAPI.jar -host 10.1.1.1 -port 12400 -user admin -passwd 12345 -adduser bob 12345
    Example 2: modify user "bob"'s home directory and fileread access java -jar FCServerAPI.jar -host 10.1.1.1:12400 -user admin/12345 -moduser bob -muHomeDir "C:\My Data\bob" -muFileRead true
    Note: temporary passwords given to users decays on the FileCatalyst Server after either 10 logins or 30 minutes, whichever happens first. Default values may be changed by modifying fcconf.conf and adding the following values:
     FCServer.server.config.user.tmp.login.expirytime.minutes=30
     FCServer.server.config.user.tmp.login.max.connections=10
     
    
     

    Copyright: Copyright (c) 2009

    Company: Unlimi-Tech Software Inc.

    • Constructor Detail

      • FCServerCLIWrapper

        public FCServerCLIWrapper()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        Main method. Parses out command line arguments
        Parameters:
        args - String[]
        Throws:
        java.lang.Exception
      • parseCommands

        protected static void parseCommands​(java.lang.String[] args,
                                            FCServerIfc fcserver)
                                     throws java.lang.Exception
        CLI parser called by MAIN method to execute commands if not using API. Should only be called by MAIN() methods and unit testers.
        Parameters:
        args - String[]
        Throws:
        java.lang.Exception
      • parseAndGetConnectionArguments

        protected static FCServerCLIWrapper.ConnectionData parseAndGetConnectionArguments​(java.lang.String[] args)
                                                                                   throws java.lang.NumberFormatException
        Parse and get the arguments for a connection
        Parameters:
        args - Arguments to use
        Throws:
        java.lang.NumberFormatException
      • usage

        public static void usage()
        Spits out usage for command-line tool usage. Triggered by including the flag -help || --help || -? || --? via the command-line.