From: Steve L. <st...@us...> - 2004-10-01 16:16:43
|
Update of /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/services/filesystem In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7250/smartfrog/src/org/smartfrog/services/filesystem Modified Files: FileImpl.java FileIntf.java TempFileImpl.java Added Files: UriIntf.java Log Message: 1. new JavaPackage component. Liveness check at sfStart time currently looks for listed resources (working). class lookup not there yet. 2. some changes to the FileIntf interface and usages, a new UriIntf to to get URIs only. 3. No integration with Java component or classloading (yet) Index: FileIntf.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/services/filesystem/FileIntf.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FileIntf.java 27 May 2004 15:12:39 -0000 1.1 --- FileIntf.java 1 Oct 2004 16:16:33 -0000 1.2 *************** *** 27,31 **** */ ! public interface FileIntf extends Remote { /* --- 27,31 ---- */ ! public interface FileIntf extends UriIntf,Remote { /* *************** *** 49,53 **** String varLength = "length"; String varIsEmpty = "isEmpty"; - String varURI = "uri"; String varShortname="shortname"; String varMustExist = "mustExist"; --- 49,52 ---- *************** *** 62,64 **** --- 61,64 ---- */ public String getAbsolutePath() throws RemoteException; + } Index: TempFileImpl.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/services/filesystem/TempFileImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TempFileImpl.java 27 Sep 2004 14:56:03 -0000 1.4 --- TempFileImpl.java 1 Oct 2004 16:16:33 -0000 1.5 *************** *** 21,33 **** import org.smartfrog.sfcore.common.SmartFrogException; import org.smartfrog.sfcore.prim.PrimImpl; import org.smartfrog.sfcore.prim.TerminationRecord; - import org.smartfrog.sfcore.prim.Prim; - import org.smartfrog.sfcore.utils.ComponentHelper; - import org.smartfrog.sfcore.logging.LogFactory; - import org.smartfrog.sfcore.logging.Log; import java.io.File; import java.io.IOException; import java.rmi.RemoteException; --- 21,33 ---- import org.smartfrog.sfcore.common.SmartFrogException; + import org.smartfrog.sfcore.logging.Log; + import org.smartfrog.sfcore.logging.LogFactory; + import org.smartfrog.sfcore.prim.Prim; import org.smartfrog.sfcore.prim.PrimImpl; import org.smartfrog.sfcore.prim.TerminationRecord; import java.io.File; import java.io.IOException; + import java.net.URI; import java.rmi.RemoteException; *************** *** 132,134 **** --- 132,143 ---- } + /** + * get the URI of this file + * + * @return + * @throws RemoteException + */ + public URI getURI() throws RemoteException { + return tempFile.toURI(); + } } --- NEW FILE: UriIntf.java --- /** (C) Copyright 1998-2004 Hewlett-Packard Development Company, LP This library 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; either version 2.1 of the License, or (at your option) any later version. 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. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For more information: www.smartfrog.org */ package org.smartfrog.services.filesystem; import java.rmi.Remote; import java.rmi.RemoteException; import java.net.URI; /** * This is an interface for anything that provides a URI * created Sep 30, 2004 3:42:23 PM */ public interface UriIntf extends Remote { String varURI = "uri"; /** * get the URI of this file * * @return * @throws RemoteException */ URI getURI() throws RemoteException; } Index: FileImpl.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/services/filesystem/FileImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FileImpl.java 11 Aug 2004 16:01:45 -0000 1.6 --- FileImpl.java 1 Oct 2004 16:16:32 -0000 1.7 *************** *** 33,36 **** --- 33,37 ---- import java.rmi.RemoteException; import java.io.File; + import java.net.URI; /** *************** *** 50,54 **** */ private Log log; ! public FileImpl() throws RemoteException { } --- 51,55 ---- */ private Log log; ! public FileImpl() throws RemoteException { } *************** *** 59,62 **** --- 60,73 ---- /** + * get the URI of this file + * + * @return + * @throws RemoteException + */ + public URI getURI() throws RemoteException { + return file.toURI(); + } + + /** * all our binding stuff. reads attributes, builds the filename, checks it, updates attributes * *************** *** 111,116 **** length = file.length(); } else { ! if(debugEnabled) log.debug("file does not exist"); ! isDirectory=isFile=false; timestamp=-1; length=0; --- 122,130 ---- length = file.length(); } else { ! if(debugEnabled) { ! log.debug("file does not exist"); ! } ! isDirectory=false; ! isFile = false; timestamp=-1; length=0; *************** *** 127,131 **** String path= getAbsolutePath(); sfReplaceAttribute(varAbsolutePath,path); ! String uri=file.toURI().toString(); sfReplaceAttribute(varURI, uri); String name=file.getName(); --- 141,146 ---- String path= getAbsolutePath(); sfReplaceAttribute(varAbsolutePath,path); ! String uri; ! uri = file.toURI().toString(); sfReplaceAttribute(varURI, uri); String name=file.getName(); *************** *** 146,150 **** log.debug(attr + " = " + flag); } ! sfReplaceAttribute(attr,new Boolean(flag)); } --- 161,165 ---- log.debug(attr + " = " + flag); } ! sfReplaceAttribute(attr,Boolean.valueOf(flag)); } *************** *** 318,320 **** --- 333,337 ---- return lookupAbsolutePath(component,new Reference(attribute),defval,baseDir, mandatory,platform); } + + } |