8 public class MyFSImpl implements MyFS{
\r
9 private String $myName = null;
\r
10 private final int $myServiceType = 2; //1 == DNS, 2 == FS
\r
11 private String $myPath = null;
\r
14 public MyFSImpl()throws RemoteException{}
\r
16 public MyFSImpl(String $pmyName, String $pmyPath)throws RemoteException{
\r
17 System.out.println("New FS-Object:"+$pmyName+" on "+$pmyPath);
\r
22 public String getMyName()throws RemoteException{
\r
25 public int getMyType()throws RemoteException{
\r
26 return $myServiceType;
\r
29 public String readFile(String $filename)throws RemoteException{
\r
30 File $f = new File($myPath+$filename);
\r
32 System.out.println("File doesnt exist: "+$f.getAbsolutePath());
\r
33 throw new RemoteException("File doesnt exist: "+$f.getAbsolutePath());
\r
35 if($f.length() >= Integer.MAX_VALUE){
\r
36 System.out.println("File tooo big: "+$f.getAbsolutePath());
\r
37 throw new RemoteException("File tooo big: "+$f.getAbsolutePath());
\r
40 InputStreamReader $in = new InputStreamReader(new FileInputStream($f));
\r
41 char[] $data = new char[((int)$f.length())];
\r
43 System.out.println("Sending file: "+$f.getAbsolutePath());
\r
45 return new String($data);
\r
46 }catch(Exception $e){
\r
47 throw new RemoteException("Exception in readFile():"+$f.getAbsolutePath());
\r