notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r1804 - in development/main: . home/transit/handler/etc/setup/authority home/transit/handler/etc/setup/authority/hosts home/transit/handler/src/main/net/dpml/io home/transit/handler/src/main/net/dpml/transit/artifact
- From: mcconnell AT netcompartner.com
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r1804 - in development/main: . home/transit/handler/etc/setup/authority home/transit/handler/etc/setup/authority/hosts home/transit/handler/src/main/net/dpml/io home/transit/handler/src/main/net/dpml/transit/artifact
- Date: Fri, 18 Feb 2005 10:10:43 +0100
Author: mcconnell
Date: Fri Feb 18 10:10:42 2005
New Revision: 1804
Added:
development/main/home/transit/handler/etc/setup/authority/hosts/
Modified:
development/main/build.bat
development/main/home/transit/handler/etc/setup/authority/hosts.xml
development/main/home/transit/handler/src/main/net/dpml/io/ResourceHelper.java
development/main/home/transit/handler/src/main/net/dpml/transit/artifact/ResourceHostFactory.java
development/main/home/transit/handler/src/main/net/dpml/transit/artifact/SecuredTransitContext.java
Log:
Updates to transit to separate the standard hosts from used defined hosts.
Modified: development/main/build.bat
==============================================================================
--- development/main/build.bat (original)
+++ development/main/build.bat Fri Feb 18 10:10:42 2005
@@ -1,3 +1,4 @@
+@echo off
REM build.bat
REM ---------
@@ -17,7 +18,6 @@
REM metro the metro group
REM
-echo off
set ID=%2
set TARGET=%1
Modified: development/main/home/transit/handler/etc/setup/authority/hosts.xml
==============================================================================
--- development/main/home/transit/handler/etc/setup/authority/hosts.xml
(original)
+++ development/main/home/transit/handler/etc/setup/authority/hosts.xml Fri
Feb 18 10:10:42 2005
@@ -2,6 +2,7 @@
<hosts>
+ <!--
<host dir="${dpml.system}/local">
<priority>20</priority>
<trusted>true</trusted>
@@ -19,6 +20,7 @@
<host href="http://www.apache.org/dist/java-repository">
<priority>100</priority>
</host>
+ -->
</hosts>
Modified:
development/main/home/transit/handler/src/main/net/dpml/io/ResourceHelper.java
==============================================================================
---
development/main/home/transit/handler/src/main/net/dpml/io/ResourceHelper.java
(original)
+++
development/main/home/transit/handler/src/main/net/dpml/io/ResourceHelper.java
Fri Feb 18 10:10:42 2005
@@ -50,6 +50,7 @@
*/
public static void unpack( ClassLoader classloader, String resource,
File destination ) throws IOException
{
+ destination.getParentFile().mkdirs();
InputStream dll = null;
FileOutputStream fos = null;
try
Modified:
development/main/home/transit/handler/src/main/net/dpml/transit/artifact/ResourceHostFactory.java
==============================================================================
---
development/main/home/transit/handler/src/main/net/dpml/transit/artifact/ResourceHostFactory.java
(original)
+++
development/main/home/transit/handler/src/main/net/dpml/transit/artifact/ResourceHostFactory.java
Fri Feb 18 10:10:42 2005
@@ -336,6 +336,11 @@
private ResourceHost createResourceHostFromDescriptor( URL hostDef )
throws TransitException, IOException
{
+ if( null == hostDef )
+ {
+ throw new NullArgumentException( "hostDef" );
+ }
+
Properties props = Util.readProps( hostDef );
URL baseUrl;
String base = Util.getProperty( props,
"dpml.transit.resourcehost.base", null );
@@ -354,7 +359,14 @@
}
catch( MalformedURLException e )
{
- throw new TransitException( base + ", found in " + hostDef + "
is not a valid URL.", e );
+ final String error =
+ "The value assigned to the base host property within a host
definition file is invalid."
+ + "\n Source: "
+ + hostDef
+ + "\n Property: dpml.transit.resourcehost.base"
+ + "\n Value: "
+ + base;
+ throw new TransitException( error, e );
}
if( base.startsWith( "file:" ) )
@@ -374,7 +386,7 @@
props, "dpml.transit.resourcehost.class",
"net.dpml.transit.artifact.ClassicResourceHost" );
- String known = Util.getProperty( props,
"dpml.transit.resourcehost.knowngroups", null ).trim();
+ String known = Util.getProperty( props,
"dpml.transit.resourcehost.knowngroups", "" );
URL groupFile = getRelativeURL( hostDef, known );
@@ -389,6 +401,7 @@
String password = Util.getProperty( props,
"dpml.transit.resourcehost.password", "" );
String prompt = Util.getProperty( props,
"dpml.transit.resourcehost.prompt", "" );
String scheme = Util.getProperty( props,
"dpml.transit.resourcehost.scheme", "" );
+
boolean enabled =
Util.getProperty(
props, "dpml.transit.resourcehost.enabled", TRUE_VALUE
).equalsIgnoreCase( TRUE_VALUE );
Modified:
development/main/home/transit/handler/src/main/net/dpml/transit/artifact/SecuredTransitContext.java
==============================================================================
---
development/main/home/transit/handler/src/main/net/dpml/transit/artifact/SecuredTransitContext.java
(original)
+++
development/main/home/transit/handler/src/main/net/dpml/transit/artifact/SecuredTransitContext.java
Fri Feb 18 10:10:42 2005
@@ -115,6 +115,11 @@
*/
private static SecuredTransitContext m_CONTEXT;
+ /**
+ * The fallback remote authority.
+ */
+ private static final String DEFAULT_REMOTE_AUTHORITY =
"http://repository.dpml.net";
+
//------------------------------------------------------------------
// state
//------------------------------------------------------------------
@@ -368,34 +373,46 @@
//
File authority = new File( transitDir, "authority" );
- authority.mkdirs();
- ClassLoader classloader = Transit.class.getClassLoader();
- ResourceHelper.unpack( classloader, "transit/" +
AUTHORITY_FILENAME, artifactAuthFile );
- ResourceHelper.unpack( classloader,
"transit/authority/cache.properties", new File( authority, "cache.properties"
) );
- ResourceHelper.unpack( classloader,
"transit/authority/hosts.xml", new File( authority, "hosts.xml" ) );
- ResourceHelper.unpack( classloader,
"transit/authority/transit.properties", new File( authority,
"transit.properties" ) );
- if( monitor.isTraceEnabled() )
+ try
{
- final String message =
- "using bundled defaults ["
- + artifactAuthFile
- + "]";
- monitor.trace( message );
- }
+ authority.mkdirs();
+ ClassLoader classloader = Transit.class.getClassLoader();
+ ResourceHelper.unpack( classloader, "transit/" +
AUTHORITY_FILENAME, artifactAuthFile );
+ ResourceHelper.unpack( classloader,
"transit/authority/cache.properties", new File( authority, "cache.properties"
) );
+ ResourceHelper.unpack( classloader,
"transit/authority/hosts.xml", new File( authority, "hosts.xml" ) );
+ ResourceHelper.unpack( classloader,
"transit/authority/transit.properties", new File( authority,
"transit.properties" ) );
+ ResourceHelper.unpack(
+ classloader, "transit/authority/hosts/local.host", new
File( authority, "hosts/local.host" ) );
+ ResourceHelper.unpack(
+ classloader,
"transit/authority/hosts/repository.dpml.net.host", new File( authority,
"repository.dpml.net.host" ) );
+ ResourceHelper.unpack(
+ classloader,
"transit/authority/hosts/www.ibiblio.org.host", new File( authority,
"www.ibiblio.org.host" ) );
+ ResourceHelper.unpack(
+ classloader,
"transit/authority/hosts/www.apache.org.host", new File( authority,
"www.apache.org.host" ) );
- return useForAuthority( artifactAuthFile );
-
- //
- //if( monitor.isTraceEnabled() )
- //{
- // final String message =
- // "using http://repository.dpml.net/ as authorative
source";
- // monitor.trace( message );
- //}
-
- //return new URL( "http://repository.dpml.net" );
+ if( monitor.isTraceEnabled() )
+ {
+ final String message =
+ "using bundled defaults ["
+ + artifactAuthFile
+ + "]";
+ monitor.trace( message );
+ }
+
+ return useForAuthority( artifactAuthFile );
+ }
+ catch( SecurityException se )
+ {
+ if( monitor.isTraceEnabled() )
+ {
+ final String message =
+ "using http://repository.dpml.net/ as authorative
source";
+ monitor.trace( message );
+ }
+ return new URL( DEFAULT_REMOTE_AUTHORITY );
+ }
}
catch( Exception e )
{
- svn commit: r1804 - in development/main: . home/transit/handler/etc/setup/authority home/transit/handler/etc/setup/authority/hosts home/transit/handler/src/main/net/dpml/io home/transit/handler/src/main/net/dpml/transit/artifact, mcconnell, 02/18/2005
Archive powered by MHonArc 2.6.24.