forked from Cloud-CV/mat-cloudcv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.m
51 lines (47 loc) · 2.28 KB
/
setup.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
%Setup.m: Used to initialize the variable
function [output] = setup(currDir)
try
addpath(strcat(currDir,'/urlreadpost'), strcat(currDir,'/urlread2'));
catch exception
if exception
output=0;
else error('problem adding path. No error caught');
end
end
% check if redis-server is up
[status,result] = system('redis-cli ping');
if (status ~= 0) && (status~=1)
error('redis-client not present. Need redis for communicating with CloudCV servers. Perhaps redis-cli is not in path? (See help setenv)');
end
if ~isequal(result,'PONG')
[status, result] = system('redis-server &');
if (status ~= 0)
disp(result);
error('redis-server not present. Need redis for communicating with CloudCV servers');
end
disp('Starting redis-server');
end
%
% javaaddpath(strcat(currDir,'/jcloudcv/lib/com.springsource.org.apache.commons.codec-1.4.0.jar'))
% javaaddpath(strcat(currDir,'/jcloudcv/lib/com.springsource.org.apache.commons.codec-1.6.0.jar'))
% javaaddpath(strcat(currDir,'/jcloudcv/lib/com.springsource.org.apache.commons.logging-1.1.1.jar'))
% javaaddpath(strcat(currDir,'/jcloudcv/lib/com.springsource.org.apache.httpcomponents.httpcore-4.2.1.jar'))
% javaaddpath(strcat(currDir,'/jcloudcv/lib/com.springsource.org.apache.httpcomponents.httpclient-4.2.1.jar'))
% javaaddpath(strcat(currDir,'/jcloudcv/lib/com.springsource.org.apache.httpcomponents.httpclient-cache-4.2.1.jar'))
% javaaddpath(strcat(currDir,'/jcloudcv/lib/com.springsource.org.apache.httpcomponents.httpmime-4.2.1.jar'))
% javaaddpath(strcat(currDir,'/jcloudcv/lib/Java-WebSocket-1.3.0.jar'))
% javaaddpath(strcat(currDir,'/jcloudcv/lib/commons-pool-1.6.jar'))
% javaaddpath(strcat(currDir,'/jcloudcv/lib/httpcore-4.2.1.jar'))
% javaaddpath(strcat(currDir,'/jcloudcv/lib/httpmime-4.2.1.jar'))
% javaaddpath(strcat(currDir,'/jcloudcv/lib/json-20131018.jar'))
% javaaddpath(strcat(currDir,'/jcloudcv/lib/log4j-1.2.14.jar'))
% javaaddpath(strcat(currDir,'/jcloudcv/lib/slf4j-api-1.6.0.jar'))
% javaaddpath(strcat(currDir,'/jcloudcv/lib/slf4j-log4j12-1.6.0.jar'))
% % javaaddpath(strcat(currDir,'/jcloudcv/bin/jcloudcv.jar'))
% javaaddpath(strcat(currDir, '/jcloudcv-1.6/bin/jcloudcv.jar'))
import io.socket.SocketIO.*
import UploadData.*
import ConfigParser.*
import SocketConnection.*
import Sockets_CCV.*
import Job.*