pandora
Class CheckSandbox

java.lang.Object
  |
  +--pandora.CheckSandbox

public class CheckSandbox
extends java.lang.Object

Check permissions in a sandboxed environment.

alexis.grandemange@pagebox.net

Copyright (c) 2002-2003 Alexis Grandemange

This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public License
 as published by the Free Software Foundation; version 2.1 of the
 License.
 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 GNU Lesser General Public License for more details.
 A copy of the GNU Lesser General Public License lesser.txt should be
 included in the distribution.

Version:
0, 0, 2
Author:
Alexis Grandemange

Nested Class Summary
(package private)  class CheckSandbox.CheckLog
          Simple implementation of a logging object for command line use.
 
Field Summary
(package private) static java.lang.String chkLib
          Name of the native library to load
(package private)  PageBoxLib.LogIF log
          Logging object
 
Constructor Summary
CheckSandbox(javax.servlet.ServletContext ctx, PageBoxLib.LogIF log)
          Constructor for CheckSandbox use in an application server.
CheckSandbox(java.lang.String[] args)
          Constructor for CheckSandbox use on the command line.
 
Method Summary
private  void checkClassLoader(java.lang.String chkClassDir)
          Check the permission to create a class loader and use it to instantiate classes.
private  void checkCmd(java.lang.String chkCmd)
          Check the permission to run a command.
private  void checkLoad()
          Check the permission to load a native library and invoke its methods.
private  void checkRead(java.lang.String chkReadFile)
          Check the permission to read a file.
private  void checkWrite(java.lang.String chkWriteFile)
          Check the permission to write and delete a file.
static void main(java.lang.String[] args)
          To use CheckSandbox on the command line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

PageBoxLib.LogIF log
Logging object


chkLib

static java.lang.String chkLib
Name of the native library to load

Constructor Detail

CheckSandbox

public CheckSandbox(javax.servlet.ServletContext ctx,
                    PageBoxLib.LogIF log)
Constructor for CheckSandbox use in an application server.

Parameters:
ctx - Servlet context
log - logging object

CheckSandbox

public CheckSandbox(java.lang.String[] args)
Constructor for CheckSandbox use on the command line.

Parameters:
args - command line arguments
Method Detail

checkRead

private void checkRead(java.lang.String chkReadFile)
Check the permission to read a file.

Parameters:
chkReadFile - path of the file to read

checkWrite

private void checkWrite(java.lang.String chkWriteFile)
Check the permission to write and delete a file.

Parameters:
chkWriteFile - path of the file to write and delete

checkCmd

private void checkCmd(java.lang.String chkCmd)
Check the permission to run a command.

Parameters:
chkCmd - path of the command to exec

checkLoad

private void checkLoad()
Check the permission to load a native library and invoke its methods.


checkClassLoader

private void checkClassLoader(java.lang.String chkClassDir)
Check the permission to create a class loader and use it to instantiate classes.

Parameters:
chkClassDir - path of the classes loaded by the class loader

main

public static void main(java.lang.String[] args)
To use CheckSandbox on the command line.