@echo off
chcp 65001
rem Warning! Save file in UTF-8!
echo usage  : start.cmd "method" "option" "name" "password"
rem method   - send, status, valid
rem option   - directory path, request ID ( "d:\dir_with_docs", "e8ccde44-52e9-11ee-ad1d-8b6146274a28")
rem name     - container name
rem password - container password
rem

set AVJCEPROV_HOME=c:\Program Files\Avest\AvJCEProv

set AVCLASSPATH=^
%AVJCEPROV_HOME%\avjavaseckit.jar;^
%AVJCEPROV_HOME%\avjavasecprov-shared.jar;^
%AVJCEPROV_HOME%\avjavasecprovintf.jar;^
%AVJCEPROV_HOME%\avjceprovlib-avbign-shared.jar;^
%AVJCEPROV_HOME%\avjceprovlib-avtoken-shared.jar;^
%AVJCEPROV_HOME%\avjutils.jar;^
%AVJCEPROV_HOME%\avkeytool.jar;^
%AVJCEPROV_HOME%\avldapcertstore.jar;^
%AVJCEPROV_HOME%\avlog.jar;^
%AVJCEPROV_HOME%\avocspclient.jar;^
%AVJCEPROV_HOME%\avoids.jar;^
%AVJCEPROV_HOME%\avpkitools.jar;^
%AVJCEPROV_HOME%\avscimport.jar;^
%AVJCEPROV_HOME%\avstores.jar;^
%AVJCEPROV_HOME%\avtlsjava-bign.jar;^
%AVJCEPROV_HOME%\avtsc.jar;^
%AVJCEPROV_HOME%\avwss4j.jar;^
%AVJCEPROV_HOME%\avxmlsecurity.jar

if exist "%AVJCEPROV_HOME%\avjavasecprov-shared.jar" (
    echo AvJCEProv exists
) else (
    GOTO notfound
)

rem -Dlogging.level.by.sws.jce=error
rem -Dspring.profiles.active=

set JAVA_HOME=".\jre"
set "JAVA_EXE=%JAVA_HOME%\bin\java.exe"
"%JAVA_EXE%" -version

set JAVA_OPTS=-Xbootclasspath/a:"%AVCLASSPATH%" -Dfile.encoding=UTF-8 -Dby.avest.loader.shared=true %5
%JAVA_EXE% %JAVA_OPTS% -jar udfl-agent-cli.jar -m %1 -o %2 -n %3 -p %4

GOTO:eof

:notfound
echo Warning! Not found AvJCEProv!
