Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
VirusCheckPlugin4Rosetta
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Digital Preservation
VirusCheckPlugin4Rosetta
Commits
cbf50a4d
Commit
cbf50a4d
authored
11 years ago
by
Andreas Romeyke
Browse files
Options
Downloads
Patches
Plain Diff
- added initParams()
parent
5e270c6a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/org/slub/rosetta/dps/repository/plugin/SLUBVirusCheckClamAVPlugin.java
+19
-6
19 additions, 6 deletions
...tta/dps/repository/plugin/SLUBVirusCheckClamAVPlugin.java
with
19 additions
and
6 deletions
java/org/slub/rosetta/dps/repository/plugin/SLUBVirusCheckClamAVPlugin.java
+
19
−
6
View file @
cbf50a4d
...
...
@@ -10,6 +10,8 @@ import java.io.InputStream;
import
java.net.InetSocketAddress
;
import
java.net.Socket
;
import
java.net.SocketException
;
import
java.util.HashMap
;
import
java.util.Map
;
// import com.exlibris.dps.repository.plugin.virusCheck;
...
...
@@ -42,19 +44,30 @@ public class SLUBVirusCheckClamAVPlugin implements VirusCheckPlugin {
private
String
signature
=
""
;
private
enum
Status
{
PASSED
,
FAILED
};
/** constructor */
SLUBVirusCheckClamAVPlugin
(
String
host
,
int
port
,
int
timeout
)
{
this
.
host
=
host
;
this
.
port
=
port
;
this
.
timeout
=
timeout
;
SLUBVirusCheckClamAVPlugin
()
{
//log.info("SLUBVirusCheckPlugin instantiated with host=" + host + " port=" + port + " timeout=" + timeout);
System
.
out
.
println
(
"SLUBVirusCheckPlugin instantiated"
);
}
/** init params to configure the plugin
* @param initp parameter map
*/
public
void
initParams
(
Map
<
String
,
String
>
initp
)
{
this
.
host
=
initp
.
get
(
"host"
);
this
.
port
=
Integer
.
parseInt
(
initp
.
get
(
"port"
));
this
.
timeout
=
Integer
.
parseInt
(
initp
.
get
(
"timeout"
));
//log.info("SLUBVirusCheckPlugin instantiated with host=" + host + " port=" + port + " timeout=" + timeout);
System
.
out
.
println
(
"SLUBVirusCheckPlugin instantiated with host="
+
host
+
" port="
+
port
+
" timeout="
+
timeout
);
}
/** stand alone check, main file to call local installed clamd
* @param args list of files which should be scanned
*/
public
static
void
main
(
String
[]
args
)
{
SLUBVirusCheckClamAVPlugin
plugin
=
new
SLUBVirusCheckClamAVPlugin
(
"127.0.0.1"
,
3310
,
60
);
SLUBVirusCheckClamAVPlugin
plugin
=
new
SLUBVirusCheckClamAVPlugin
();
Map
<
String
,
String
>
initp
=
new
HashMap
<
String
,
String
>();
initp
.
put
(
"host"
,
"127.0.0.1"
);
initp
.
put
(
"port"
,
"3310"
);
initp
.
put
(
"timeout"
,
"60"
);
plugin
.
initParams
(
initp
);
System
.
out
.
println
(
"Agent: "
+
plugin
.
getAgent
());
for
(
String
file
:
args
)
{
plugin
.
scan
(
file
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment