Ok I'm a little dense so bear with me. I see the webserver now recognizes and sets the mime type based on the .meta file extension. Why is this so significant to us?
Your example is also very confusing to me as well. Can you explain it? Why would trying to get http://www.apache.org/~mcconnell/test/example work. You only have the following in this directory: example.jar example.jar.meta Alex > Based on some help from Erik Abele on infrastructure I was able to > sort this one out. Erik put together a test case in C to validate > that the Apache server was doing its thing with respect to content > negotiation - which left me with the problem of resolving the issues > with the Java approach. > > Detailed below are the issues and solutions. > > > Stephen McConnell wrote: > > > > > Have started some experimentation with content negotiation > > and I think I need a mime type addition to server running > > www.apache.org. > > > > I have setup the following test content: > > > > http://www.apache.org/~mcconnell/ > > > > This contains a single jar file and a test file containing > > metadata about the jar file. > > > > example.jar > > example.jar.meta > > > > I've also put together a little test case that creates a url > > to the artifact http://www.apache.org/~mcconnell/example > > and then sets the "accept" request parameter to "text/x-meta". > > Presumably the mime type used here ("text/x-meta") needs to be > > declared on the Apache server with a mapping to the ".meta" > > extension. > > > > Does anyone know if this is something I can configure > > in the enclosing directory - or do I need post a request to > > infrastructure? > > > You can declare MIME type additions by putting in place a .htaccess file > somewhere in the filesystem. For the above example I declared a > "text/x-meta" MIME type using a .htaccess file containing the following: > > AddType text/x-meta .meta > > > > > Here is a fragment of the relevant java source: > > > > URL url = new URL( "http://www.apache.org/~mcconnell/test/example" ); > > URLConnection connection = url.openConnection(); > > connection.setRequestProperty( "accept", "text/x-meta" ); > > > The above line contains a bug. > To operate corectly the request property key should be "Accept" (note > that the value is case sensitive). > > > > > getLogger().info( "input" ); > > InputStream input = (InputStream) connection.getContent(); > > Properties properties = new Properties(); > > properties.load( input ); > > > > Without the mime mapping the above code will result in the stuffing > > of the jar file into the properties file which is not exactly > > what we want. > > > Using the following URL: > > http://www.apache.org/~mcconnell/test/example > > I can pull down the meta info using the attached testcase resulting in: > > [INFO ] (playground.demo): name: avalon-activation-impl > [INFO ] (playground.demo): group: avalon-activation > [INFO ] (playground.demo): version: 1.2.2-dev > [INFO ] (playground.demo): signature: 20031111.020554 > > Example source is attached. > > Cheers, Steve. > > -- > > Stephen J. McConnell > mailto:[EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
