proyal 2003/03/04 13:09:01
Modified: sevak/src/java/org/apache/avalon/apps/sevak/blocks/deployer
SevakDeployer.java
Log:
If the docBase begins with 'file:', treat it as an absolute path. Excellent
for development purposes!
Revision Changes Path
1.3 +16 -4
avalon-apps/sevak/src/java/org/apache/avalon/apps/sevak/blocks/deployer/SevakDeployer.java
Index: SevakDeployer.java
===================================================================
RCS file:
/home/cvs/avalon-apps/sevak/src/java/org/apache/avalon/apps/sevak/blocks/deployer/SevakDeployer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SevakDeployer.java 13 Feb 2003 14:14:28 -0000 1.2
+++ SevakDeployer.java 4 Mar 2003 21:09:01 -0000 1.3
@@ -84,7 +84,7 @@
public void contextualize( final Context context )
{
- m_context = ( BlockContext ) context;
+ m_context = (BlockContext)context;
}
/**
@@ -104,7 +104,7 @@
throws ServiceException
{
m_manager = serviceManager;
- m_sevak = ( Sevak ) m_manager.lookup( Sevak.ROLE );
+ m_sevak = (Sevak)m_manager.lookup( Sevak.ROLE );
}
public void initialize() throws Exception
@@ -119,8 +119,7 @@
path.replace( '/', File.separatorChar ).replace( '\\',
File.separatorChar );
- final File pathFile = new File(
m_context.getBaseDirectory().getAbsolutePath()
- + File.separatorChar + path );
+ final File pathFile = getAbsolutePath( path );
if( !pathFile.exists() )
{
@@ -134,6 +133,19 @@
}
m_sevak.deploy( context, pathFile, sevakContext );
+ }
+ }
+
+ private File getAbsolutePath( String path )
+ {
+ if( path.startsWith( "file:" ) )
+ {
+ return new File( path.substring( "file:".length() ) );
+ }
+ else
+ {
+ return new File( m_context.getBaseDirectory().getAbsolutePath()
+ + File.separatorChar + path );
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]