Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2971 - in development/main: magic transit/core/handler/src/main/net/dpml/transit/model transit/core/handler/src/main/net/dpml/transit/unit transit/core/handler/src/main/net/dpml/transit/util

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell AT dpml.net
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r2971 - in development/main: magic transit/core/handler/src/main/net/dpml/transit/model transit/core/handler/src/main/net/dpml/transit/unit transit/core/handler/src/main/net/dpml/transit/util
  • Date: Mon, 04 Jul 2005 20:38:15 -0400

Author: mcconnell AT dpml.net
Date: Mon Jul 4 20:38:15 2005
New Revision: 2971

Modified:
development/main/magic/module.xml

development/main/transit/core/handler/src/main/net/dpml/transit/model/DefaultCacheModel.java

development/main/transit/core/handler/src/main/net/dpml/transit/unit/CacheStorageUnit.java

development/main/transit/core/handler/src/main/net/dpml/transit/unit/TransitPreferences.java

development/main/transit/core/handler/src/main/net/dpml/transit/util/Util.java
Log:
o Remove the defacto resolution of symbolds in the property loading which
enables full symbolic references inside preferences.
o Update the magic build to create a zip artifact containing the platform
neutral distributon.

Modified: development/main/magic/module.xml
==============================================================================
--- development/main/magic/module.xml (original)
+++ development/main/magic/module.xml Mon Jul 4 20:38:15 2005
@@ -119,6 +119,17 @@
<fileset dir="target/dist"/>
</copy>

+ <!-- zip up a copy of the platform independent bundle for use by depot
-->
+
+ <property name="zip.filename"
+
value="${basedir}/target/deliverables/zips/${project.name}-${project.version}.zip"/>
+ <mkdir dir="target/deliverables/zips"/>
+ <zip destfile="${zip.filename}" whenempty="create">
+ <zipfileset dir="${bundle}">
+ <include name="**/*"/>
+ </zipfileset>
+ </zip>
+
</target>

<target name="install" depends="standard.install,junit-report,checkstyle">

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/model/DefaultCacheModel.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/model/DefaultCacheModel.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/model/DefaultCacheModel.java
Mon Jul 4 20:38:15 2005
@@ -165,6 +165,7 @@
{
throw new NullPointerException( "path" );
}
+
String resolved = PropertyResolver.resolve( path );
File cache = new File( resolved );
if( false == cache.isAbsolute() )
@@ -182,9 +183,9 @@
getLogger().debug( "updating cache: " + cache );
}
m_cache = cache;
- m_home.setCacheDirectoryPath( path );
if( notify )
{
+ m_home.setCacheDirectoryPath( path );
CacheDirectoryChangeEvent event = new
CacheDirectoryChangeEvent( this, path );
enqueueEvent( event );
}

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/unit/CacheStorageUnit.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/unit/CacheStorageUnit.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/unit/CacheStorageUnit.java
Mon Jul 4 20:38:15 2005
@@ -133,7 +133,8 @@
public String getCacheDirectoryPath()
{
Preferences prefs = getPreferences();
- return prefs.get( "location", "${dpml.data}/cache" );
+ String path = prefs.get( "location", "${dpml.data}/cache" );
+ return path;
}

private Preferences getHostsNodePreferences()

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/unit/TransitPreferences.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/unit/TransitPreferences.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/unit/TransitPreferences.java
Mon Jul 4 20:38:15 2005
@@ -174,7 +174,7 @@
//}
Preferences host = hostsPrefs.node( name );
URL hostUrl = fileToURL( file );
- Properties properties = Util.readProps( hostUrl );
+ Properties properties = Util.readProps( hostUrl,
false );
setupHost( properties, host );
}
}
@@ -218,7 +218,7 @@
{
try
{
- Properties properties = Util.readProps( resource );
+ Properties properties = Util.readProps( resource, false );
setupCachePreferences( properties, prefs );
}
catch( IOException ioe )
@@ -238,11 +238,6 @@
{
prefs.put( "location", location );
}
- String classname = properties.getProperty(
CacheModel.CACHE_CLASS_KEY );
- if( null != classname )
- {
- prefs.put( "classname", classname );
- }
String resolver = properties.getProperty(
CacheModel.CACHE_LAYOUT_KEY );
if( null != resolver )
{
@@ -264,7 +259,7 @@
try
{
Preferences host = prefs.node( name );
- Properties properties = Util.readProps( url );
+ Properties properties = Util.readProps( url, false );
setupHost( properties, host );
}
catch( IOException ioe )
@@ -281,7 +276,7 @@
{
try
{
- Properties properties = Util.readProps( hostDef );
+ Properties properties = Util.readProps( hostDef, false );
String id = properties.getProperty( HOST_ID_KEY );
if( null == id )
{

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/util/Util.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/util/Util.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/util/Util.java
Mon Jul 4 20:38:15 2005
@@ -49,19 +49,35 @@
public static Properties readProps( URL propsUrl )
throws IOException
{
+ return readProps( propsUrl, true );
+ }
+
+ /**
+ * Read a set of properties from a property file specificed by a url.
+ * Property files may reference symbolic properties in the form ${name}.
+ * @param propsUrl the url of the property file to read
+ * @return the resolved properties
+ * @exception IOException if an io error occurs
+ */
+ public static Properties readProps( URL propsUrl, boolean resolve )
+ throws IOException
+ {
InputStream stream = propsUrl.openStream();
try
{
Properties p = new Properties();
- p.setProperty( Transit.HOME_KEY, Transit.DPML_HOME.toString() );
p.load( stream );
- Iterator list = p.entrySet().iterator();
- while ( list.hasNext() )
+ if( resolve )
{
- Map.Entry entry = (Map.Entry) list.next();
- String value = (String) entry.getValue();
- value = resolveProperty( p, value );
- entry.setValue( value );
+ p.setProperty( Transit.HOME_KEY,
Transit.DPML_HOME.toString() );
+ Iterator list = p.entrySet().iterator();
+ while ( list.hasNext() )
+ {
+ Map.Entry entry = (Map.Entry) list.next();
+ String value = (String) entry.getValue();
+ value = resolveProperty( p, value );
+ entry.setValue( value );
+ }
}
return p;
}



  • svn commit: r2971 - in development/main: magic transit/core/handler/src/main/net/dpml/transit/model transit/core/handler/src/main/net/dpml/transit/unit transit/core/handler/src/main/net/dpml/transit/util, mcconnell, 07/04/2005

Archive powered by MHonArc 2.6.24.

Top of Page