DO NOT REPLY [Bug 34204] - [configuration] XMLConfiguration ignore a specific encoding in XML declaration
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=34204. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=34204 --- Additional Comments From [EMAIL PROTECTED] 2005-03-30 10:28 --- We will have the same issue with all configuration formats supporting an encoding declaration inside the file, that's all XML based formats (XML properties, XML property list), YAML and OGDL. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (JELLY-206) cannot nest catch tags
[ http://issues.apache.org/jira/browse/JELLY-206?page=history ] Frank Cornelis updated JELLY-206: - Attachment: CatchTag-inside-define-tag-tracking-local-context.patch This patch makes that j:catch keeps track of all received contexts. This is needed when used inside a define:tag. cannot nest catch tags -- Key: JELLY-206 URL: http://issues.apache.org/jira/browse/JELLY-206 Project: jelly Type: Bug Components: core / taglib.core Versions: 1.0-RC2 Environment: jelly:junit test Reporter: Frank Cornelis Attachments: CatchTag-inside-define-tag-tracking-local-context.patch The outer tag does not receive the 'rethrown' exception. How come? ?xml version=1.0? test:suite xmlns:j=jelly:core xmlns:test=jelly:junit xmlns:define=jelly:define xmlns:log=jelly:log test:case name=nested exceptions xmlns:my=mytaglib define:taglib uri=mytaglib define:tag name=mytag j:scope j:catch var=ex define:invokeBody/ /j:catch log:infomytag ${name} after catch block exception: ${ex}/log:info j:if test=${ex != null} log:debugexception was caught !!!/log:debug test:failrethrowing the exception/test:fail log:debugCANNOT REACH THIS POINT !!!/log:debug /j:if /j:scope /define:tag /define:taglib my:mytag name=outer my:mytag name=inner test:failboom/test:fail /my:mytag /my:mytag /test:case /test:suite -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 34204] - [configuration] XMLConfiguration ignore a specific encoding in XML declaration
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=34204. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=34204 --- Additional Comments From [EMAIL PROTECTED] 2005-03-30 10:36 --- Created an attachment (id=14592) -- (http://issues.apache.org/bugzilla/attachment.cgi?id=14592action=view) Fix for XMLConfiguration This is a simple patch that should solve this issue for XMLConfiguration, I haven't tested it thoroughly yet. Also we will have to check that the value returned by getEncoding() is consistent with the actual encoding of the file. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [vfs] parsing uri
By the way could you add the following to VFS public static void close() { BTW you know its sideeffects? You no longer can use VFS in threaded environments as this close closes ALL filesystems. (I have some gc problems and this alleviates it a bit) Lets try to figure it out. I use vfs in an webapp and never had a problem with memory consumption. Maybe I can add a method to dump the cache content, that way we might find whats the problem - if its VFS fault. Well I don´t see the gc problem as vfs problem as much as jvm gc problem. My app is a plugin to an editor that I want to reload by removing all references to plugin classloader. And then load a new version with a new classloader. The problem is that no matter how much I get rid of references (and see with a memory debugger that there are no references) the classloader and the classes it has loaded will not go away. I have tested that the unloading of classloaders does work in simple cases but not when a lot has happened in the classloader. Now when the classloader does not get unloaded neither will any static fields. VFS has some static fields for perfectly good reasons (caching). So all I need is the ability to tell VFS that I am done with you try to free the memory you have reserved (in static fields) because your classloader does not want to unload you. Actually I should send this request to SUN and say that there should be a close method in classloader but I don´t think they would listen. Note. I also use the deprecated stop method in thread class because in some cases it is the only way and is very good. So if it could help you could also make the close method deprecated and say in docs that one should be VERY careful when using it. - rami - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [chain] [nag] Please commit stuff for DispatchChain
I know its been a while since we discussed this ... but I would like to bring up the issue of DispatchChain again. I have a pressing need for something like this in my current application. I need to go ahead and move it into our project codebase or have it added to commons-chain. No hard feelings if I cannot convince you that this is useful. I will briefly summarize my arguments again. The dispatch chain allows you to compose a chain of commands where the command method can be something other than execute. It will always have the same arguments and it will always be the same for every command in the chain. I think the fact that it is always the same method for every command in the chain is a key point here. Its still the CoR pattern. There is nothing special about the name of the execute method, the pattern just requires a consistent method. If you do not accept this line of reasoning then I would suggest that DispatchLookupCommand be removed from the codebase as well. I don't think you can justify one and not the other. Finally, its in the generic package so its entirely optional if you don't want to use it. I'd like to resolve this ASAP so I can go forward on my project here at work. Please give some thought to my arguments. As I said earlier, I will accept the decision of the group if the group cannot be persuaded. Regards, sean On Fri, 14 Jan 2005 16:09:11 -0500, Sean Schofield [EMAIL PROTECTED] wrote: My original post to bugzilla didn't generate any responses. I figured once I wrote something and started pestering for a commit that would get the discussion going ;-) I will await your guys feedback once you've had a chance to think about use cases, etc. Let me know if you have any questions. sean On Fri, 14 Jan 2005 11:37:47 -0600, Joe Germuska [EMAIL PROTECTED] wrote: At 9:20 AM -0800 1/14/05, Craig McClanahan wrote: I plead guilty to being lukewarm (is lukecold a word? :-) about DispatchChain and friends being part of the standard chain package -- I'd like to spend some time tomorrow (Saturday) looking at the code and seeing if I buy in to Sean's use cases. This has been my hesitation too. Since I haven't yet had a use case for it, it seems a bit heavy for inclusion in the core library. I wouldn't veto it, but it's why I have been hesitant. Like Craig, I haven't looked very carefully at it, so I haven't spoken up yet. Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Narrow minds are weapons made for mass destruction -The Ex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r159506 - jakarta/commons/proper/chain/trunk/xdocs/cookbook.xml
Author: martinc Date: Wed Mar 30 10:49:03 2005 New Revision: 159506 URL: http://svn.apache.org/viewcvs?view=revrev=159506 Log: Remove obsolete information about a default context attribute being set if none is specified in web.xml. Modified: jakarta/commons/proper/chain/trunk/xdocs/cookbook.xml Modified: jakarta/commons/proper/chain/trunk/xdocs/cookbook.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/chain/trunk/xdocs/cookbook.xml?view=diffr1=159505r2=159506 == --- jakarta/commons/proper/chain/trunk/xdocs/cookbook.xml (original) +++ jakarta/commons/proper/chain/trunk/xdocs/cookbook.xml Wed Mar 30 10:49:03 2005 @@ -795,13 +795,9 @@ !-- ... --]]/source/p /example/p -pBy default, ChainListener will create an application-scope attribute -by the name of catalog./p - -pThe default attribute name can be changed, if needed. You can also -configure ChainListener to read files from a system path or from a JAR. -See the JavaDoc for all the configuration details. There is also a -codeChainServlet/code if you are using the Servlet 2.2 +pYou can also configure ChainListener to read files from a system path +or from a JAR. See the JavaDoc for all the configuration details. There +is also a codeChainServlet/code if you are using the Servlet 2.2 platform./p pUsing the default attribute, and given an - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [collections] Generics/JDK 5
Hello Chris, Thanks for your information. I got the source from the cvs on sourceforge, however to compile it is missing the class net.sf.collections15.collection.AbstractCollectionDecorator. I compared your adoption of the generics with what I've done and we've arrived at very similar solutions. Just two points: * you generified Closure, Factory and Predicate with the type variable E, I would prefer to write the type variable as T, like in java.util.ComparatorT. This is however mostly cosmetical. * you generified the MultiMap to public interface MultiMap K, V extends MapK, V, I would prefer public interface MultiMap K, V extends MapK, CollectionV in accordance with the javadoc: Defines a map that holds a collection of values against each key. Regards, Thomas Chris Lambrou schrieb: Hello Thomas, You're right. There was a brief discussion about a Java 5.0 port of collections. The upshot was the project that Michael has pointed out on SourceForge. There are two people working on this at the moment - myself and Mauro Franceschini. After an initial bout of work on this project, I'm afraid I've been hit by a number of personal problems over the past few months, so have virtually no time to do any work with it. Hopefully that should change soon, so I'll be able to start working on it again. If you're interested in discussing collections15 and perhaps contributing, then have a look at what's been done so far. I started by generifying them all, but as I've moved on to providing implementations of them, it's become obvious that small changes have been needed here and there. After converting all of the interfaces, I decided to start providing implementation of some of the simpler ones (basically the functor interfaces - Predicate, Closure, Transformer, Comparator, etc.). Mauro has also started work on Lists and Iterators. Any comments and/or help would be greatly appreciated. Chris Michael Heuer wrote: http://collections15.sourceforge.net/ michael On Thu, 24 Mar 2005, Thomas Klaeger wrote: Hello, I was looking for a generics-capable version of commons-collections, however everything I could find were to small threads on the mailing list. Instead of complaining I decided to work on it myself. The first thing I did was creating a generics-version of the various interfaces provided by commons-collections. Now I'm seeking your advice: where should I put the changed source files, as some discussion is sorely needed? Regards, Thomas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 34212] - [betwixt] No way to resolve proxied objects
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=34212. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=34212 --- Additional Comments From [EMAIL PROTECTED] 2005-03-30 23:09 --- Hi Matthew Sounds like a very reasonable request but i'm not sure when i'll be able to get round to coding it (very busy at work right now and sorting out JCL is my major priority). Should be easy to code (i think) so why not create a patch (preferrably with unit tests and documentation)? Robert -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 29716] - [configuration] Disabling string splitting
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=29716. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=29716 --- Additional Comments From [EMAIL PROTECTED] 2005-03-30 23:17 --- I'd like to propose a different solution: do not do the parsing until the getString or getList method is called. So if getString method is called delimiter is not looked for, but if the getList method is used then you should parse the string using the delimiter. IMHO this is a lot nicer and is what users would expect. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [vfs] parsing uri
Your asumption about the used servers is correct. Now why uml or vmware: It is a pain to setup all this stuff and keep it in sync with any junit changes. With uml or vmware I can provide a image one simply can drop into its box and startup the tests. So no security problem, just to simplify the installation. Sounds good. Vmware is the best IMHO around. I have used it only their cracked open source so I don't know about their goodwill to open source dudes :) Just as a sidenote: I think it is not the responsibility of VFS to ensure running with different server implementations. The used libraries should handle this. Though, we should do what we can to support them finding problems with exotic platforms. Good point. agree. I am not at home now, I will send one later. Take your time. I don't pay anything for this :) Tempfs uses the DefaultFileReplicator to handle its content. So where are the files stored? Do they get deleted when vfs closes. Or when jvm closes? what if jvm crashes? - url provider bothers me because it kind of duplicates vfs. And it DUPLICATES the effort of vfs (http, ftp, jar ...) Now you get emotional ;-) Its better to integrate than to rule out. We also provide a method to wrap VFS into a URLConnection. I was not emotional. I was rational. Now that I have been sipping some italian red wine I am ready to get emotional. What do you mean by integration? Integrate into what? The point is that it does not offer any capabilities that are not already provided by vfs. So i does not give any further integrative possibilities. What it does give is undocumented features that duplicate documented features. And it does not work (probably) with all implementations of Java API. And the whole project of accessing any urls with some api (like the URLConnection API) is doomed to fail because url is such a broad concept and there will be cases of url that fit VERY badly to the API. I mean you can point to anything with URL (that is where the universal comes from). And you can not have a meaningful api to ANYTHING. URIs and URLs are about universal naming in the world of computers (and internet specifically). Api's tend to go beyond naming. Further this let's embrace everything attitude will take vfs into the world of yet another universal whatever. And the evolution is like this. A lot of good things and features are provided that are trendy at the moment. When the system becomes too messy to understans it is forgotten. Virtual filesystem can mean anything because of the magic word virtual. But I wish this would be just a filesystem that can integrate different kinds of filesystems on the network. That already is a tall order. And also note that filesystem model is very simple hierarchical model. So we should not see it as the ultimate way to model and interact with data. I think I am still being rational but in a good emotianal way :) - rami - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 30667] - [io] new throttled input and output stream classes
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=30667. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=30667 --- Additional Comments From [EMAIL PROTECTED] 2005-03-30 23:40 --- another tryed and true implementation of this feature at http://cvs.sourceforge.net/viewcvs.py/freenet/freenet/src/freenet/support/io/ThrottledOutputStream.java?view=markup is also used by limewire http://www.limewire.org/fisheye/viewrep/limecvs/core/com/limegroup/gnutella/util/ThrottledOutputStream.java?r=1.3 but we still need a copy in this package -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[VOTE][RESULT] Add James Carman as Commons Proper committer [KARMA request]
4 +1s, no other votes - Stephen Colebourne - Robert Burrel Donkin - Phil Steitz - Simon Kitching Could someone with karma powers please grant jcarman access to commons sandbox and proper including SVN, thanks. Stephen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[lang] New StringUtils method - defaultIfEmpty
Currently we have two default methods, both of which default when the string parameter is null. At my job we just had need of a default if empty method: public String defaultIfEmpty(String str, String defaultString) { if (isEmpty(str)) { return defaultString; } else { return str; } } Does this sound OK to add? Stephen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [VOTE][RESULT] Add James Carman as Commons Proper committer [KARMA request]
Added to the SVN auth file. There may be a short delay before access is actually granted. -- Martin Cooper On Wed, 30 Mar 2005 23:18:49 +0100, Stephen Colebourne [EMAIL PROTECTED] wrote: 4 +1s, no other votes - Stephen Colebourne - Robert Burrel Donkin - Phil Steitz - Simon Kitching Could someone with karma powers please grant jcarman access to commons sandbox and proper including SVN, thanks. Stephen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 34204] - [configuration] XMLConfiguration ignore a specific encoding in XML declaration
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=34204. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=34204 --- Additional Comments From [EMAIL PROTECTED] 2005-03-31 03:52 --- Thank you so much for your support. But, the patch seems not to modify FileConfigurationDelegate in XMLConfiguration. Because AbstractFileConfiguration#load(URL url) calls FileConfigurationDelegate#load(Inputstream), XMLConfiguration#load(Inputstrem) will not be called when I use ConfigurationFactory#getConfiguration(). Here is the its sample. I'm Sorry that it is not patch... private class FileConfigurationDelegate extends AbstractFileConfiguration { public void load(InputStream in) throws ConfigurationException // add this {// add this UseXmlEncodingHierarchicalXMLConfiguration.this.load(in);// add this }// add this public void load(Reader in) throws ConfigurationException -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [vfs] parsing uri
Rami Ojares wrote: So where are the files stored? The FileReplicator creates a vfs_cache directory and takes care of its content. Do they get deleted when vfs closes. Yes, but only if you tell VFS to close e.g. ((DefaultFileSystemManager) VFS.getManager()).close(); Oh, boy - how do you to this? How do you find all those stinky nooks? ;-) Or when jvm closes? Nope! Before you ask - No, I dont want to use deleteFileOnExit function - we already discussed it. But what I can do is to implement a shutdown-hook and try to cleanly shutdown VFS then. what if jvm crashes? Bad luck! ;-) Now that I have been sipping some italian red wine I am ready to get emotional. I go green with envy! What do you mean by integration? Integrate into what? The point is that it does not offer any capabilities that are not already provided by vfs. So i does not give any further integrative possibilities. Yes, yes and yes, you might be right with all you say, but ... now we have it. And I think the main intention was to allow ftp and http (read-onl) access on systems where no commons-net or httpclient available, though do not know how well it works. You and I do not use it, and do not like it ... good, our point of view. Again - now we have it and there is no need to remove it - we wont be bothered. Further this let's embrace everything attitude will take vfs into the world of yet another universal whatever. As you might have seen I implemented the plugin-resolve-stuff. Now we could extend VFS by simply drop a jar into the classpath and if we find a /META-INF/vfs-plugins.xml it would be added. That way we could keep the VFS core slim and could provide extension jars to allow whatever we can think of. I think this is a good compromise. And also note that filesystem model is very simple hierarchical model. So we should not see it as the ultimate way to model and interact with data. No one do, do we? But I already talked about, think of accessing your mailfolder through an imap provider and your mailcontent through an mime provider. e.g. mime:imap://[EMAIL PROTECTED]/INBOX/mail9012718!/part1.txt Sooner or later, this might happen ... and why not - its cool, isnt it? Now that we have the plugin stuff we could do it without bloating the core. --- Mario - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [collections] Generics/JDK 5
Hi Thomas. I'm Mauro, the other developer on the project. Maybe that the missing class is a my fault, because I forget to commit the source file for the missing class. This evening, I look at the project at my home and I try to solve the problem. Regards. Mauro. On Wed, 30 Mar 2005 22:23:21 +0200, Thomas Klaeger [EMAIL PROTECTED] wrote: Hello Chris, Thanks for your information. I got the source from the cvs on sourceforge, however to compile it is missing the class net.sf.collections15.collection.AbstractCollectionDecorator. I compared your adoption of the generics with what I've done and we've arrived at very similar solutions. Just two points: * you generified Closure, Factory and Predicate with the type variable E, I would prefer to write the type variable as T, like in java.util.ComparatorT. This is however mostly cosmetical. * you generified the MultiMap to public interface MultiMap K, V extends MapK, V, I would prefer public interface MultiMap K, V extends MapK, CollectionV in accordance with the javadoc: Defines a map that holds a collection of values against each key. Regards, Thomas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r159536 - in jakarta/commons/sandbox/vfs/trunk: src/java/org/apache/commons/vfs/impl/StandardFileSystemManager.java xdocs/api.xml xdocs/index.xml
Author: imario Date: Wed Mar 30 15:11:40 2005 New Revision: 159536 URL: http://svn.apache.org/viewcvs?view=revrev=159536 Log: process /META-INF/vfs-providers.xml found in the classpath Modified: jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/impl/StandardFileSystemManager.java jakarta/commons/sandbox/vfs/trunk/xdocs/api.xml jakarta/commons/sandbox/vfs/trunk/xdocs/index.xml Modified: jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/impl/StandardFileSystemManager.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/impl/StandardFileSystemManager.java?view=diffr1=159535r2=159536 == --- jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/impl/StandardFileSystemManager.java (original) +++ jakarta/commons/sandbox/vfs/trunk/src/java/org/apache/commons/vfs/impl/StandardFileSystemManager.java Wed Mar 30 15:11:40 2005 @@ -26,8 +26,15 @@ import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; import java.net.URL; import java.util.ArrayList; +import java.util.StringTokenizer; +import java.util.jar.JarFile; +import java.util.jar.JarEntry; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; /** * A [EMAIL PROTECTED] org.apache.commons.vfs.FileSystemManager} that configures itself @@ -45,6 +52,7 @@ private Log log = LogFactory.getLog(StandardFileSystemManager.class); private static final String CONFIG_RESOURCE = providers.xml; +private static final String PLUGIN_CONFIG_RESOURCE = META-INF/vfs-providers.xml; private String configUri; private ClassLoader classLoader; @@ -95,10 +103,77 @@ // Configure configure(configUri); +// Configure Plugins +configurePlugins(); + // Initialise super-class super.init(); } +/** + * Scans the classpath to find any droped plugin.br / + * The plugin-description has to be in /META-INF/vfs-providers.xml + */ +protected void configurePlugins() throws FileSystemException +{ +String classpath = System.getProperty(java.class.path); +if (classpath == null) +{ +// huh? why should that be? +return; +} + +StringTokenizer st = new StringTokenizer(classpath, File.pathSeparator, false); +while (st.hasMoreTokens()) +{ +String path = st.nextToken(); + +if (path.length() 4 path.substring(path.length()-4).toLowerCase().equals(.jar)) +{ +try +{ +JarFile jarFile = new JarFile(path); +JarEntry jarEntry = jarFile.getJarEntry(PLUGIN_CONFIG_RESOURCE); +if (jarEntry != null) +{ +InputStream configStream = null; +try +{ +configStream = jarFile.getInputStream(jarEntry); +configure(jarEntry.getName(), configStream); +} +finally +{ +if (configStream != null) +{ +configStream.close(); +} +} +} +} +catch (FileSystemException e) +{ +// VFS exception - rethrow +// Need to do this as FileSystemException extends IOException +throw e; +} +catch (IOException e) +{ +// Maybe a damaged jar? Complain about but continue ... +log.warn(e.getLocalizedMessage(), e); +} +} +else +{ +File config = new File(path, PLUGIN_CONFIG_RESOURCE); +if (config.exists() config.canRead()) +{ +configure(config.getAbsolutePath()); +} +} +} +} + protected DefaultFileReplicator createDefaultFileReplicator() { return new DefaultFileReplicator(); @@ -113,49 +188,87 @@ { // Load up the config // TODO - validate -final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); -factory.setIgnoringElementContentWhitespace(true); -factory.setIgnoringComments(true); -factory.setExpandEntityReferences(true); -final DocumentBuilder builder = factory.newDocumentBuilder(); +final DocumentBuilder builder = createDocumentBuilder(); final
svn commit: r159541 - in jakarta/commons/sandbox/vfs/trunk/xdocs: api.xml index.xml
Author: imario Date: Wed Mar 30 15:20:34 2005 New Revision: 159541 URL: http://svn.apache.org/viewcvs?view=revrev=159541 Log: document /META-INF/vfs-providers.xml Modified: jakarta/commons/sandbox/vfs/trunk/xdocs/api.xml jakarta/commons/sandbox/vfs/trunk/xdocs/index.xml Modified: jakarta/commons/sandbox/vfs/trunk/xdocs/api.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/vfs/trunk/xdocs/api.xml?view=diffr1=159540r2=159541 == --- jakarta/commons/sandbox/vfs/trunk/xdocs/api.xml (original) +++ jakarta/commons/sandbox/vfs/trunk/xdocs/api.xml Wed Mar 30 15:20:34 2005 @@ -62,24 +62,9 @@ subsection name=Cache p -By default every resolved file will be cached in an map and - unhappily - it will never be released. -This is what -a href=apidocs/org/apache/commons/vfs/cache/SoftRefFilesCache.htmlSoftRefFilesCache/a -tries to address. +Commons VFS uses a a href=apidocs/org/apache/commons/vfs/cache/SoftRefFilesCache.htmlSoftRefFilesCache/a to release memory if a file is no longer used by the application. /p p -Currently you could not use VFS.getManager() to use this sort of cache, instead you have to create -your own FileSytemManager instance. -/p -source![CDATA[ -private static FileSystemManager manager; - -manager = new StandardFileSystemManager(); -manager.setFilesCache(new SoftRefFilesCache()); -manager.init(); -]]/source - -p This cache will return the same instance for a file as long as it is strongly reachable e.g. you hold a reference to this object. If the FileObject is no longer reachable, and the jvm needs some memory, it will be released. @@ -109,6 +94,15 @@ a href=apidocs/org/apache/commons/vfs/VFS.html#getManager()VFS.getManager()/a method, which returns the default Commons VFS implementation. /p +p +This method will also automatically scan the classpath for a /META-INF/vfs-providers.xml file +(also in jar files). +If such a file is found Commons VFS uses it in uaddition/u to the default providers.xml. +This allows you to start using a new filesystem by simply drop its implementation into the classpath. +The configuration file format is described below.br / +bNotice:/b Currently it is not allowed to override a already configured filesystem. Commons VFS throws +an exception if there is already a filesystem for a scheme. +/p p To configure Commons VFS programatically, you can create an @@ -178,16 +172,6 @@ codesetConfiguration()/code method to set the location of the configuration file to use. The configuration file format is described below. -/p - -p -The fourth method is in addition to the default providers.xml. -This method automatically scans the classpath for a /META-INF/vfs-providers.xml file (even if it is within an jar). -If such a file is found Commons VFS uses it in addition to the default. -This allows you to start using a new filesystem by simply drop its implementation into the classpath. -The configuration file format is described below.br / -bNotice:/b Currently it is not allowed to override a already configured filesystem. Commons VFS throws -an exception if there is already a filesystem for a scheme. /p p Modified: jakarta/commons/sandbox/vfs/trunk/xdocs/index.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/vfs/trunk/xdocs/index.xml?view=diffr1=159540r2=159541 == --- jakarta/commons/sandbox/vfs/trunk/xdocs/index.xml (original) +++ jakarta/commons/sandbox/vfs/trunk/xdocs/index.xml Wed Mar 30 15:20:34 2005 @@ -47,7 +47,7 @@ /section section name=News -p2005-03 - [EMAIL PROTECTED]: easier configuration for plugins/p +p2005-03 - [EMAIL PROTECTED]: easier configuration for plugins - see api section for details/p p2005-03 - [EMAIL PROTECTED]: The filename parsing and api has changed. ul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r159551 - jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java
Author: ggregory Date: Wed Mar 30 16:56:20 2005 New Revision: 159551 URL: http://svn.apache.org/viewcvs?view=revrev=159551 Log: Removed extra C style parens in return statements. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java?view=diffr1=159550r2=159551 == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java Wed Mar 30 16:56:20 2005 @@ -192,7 +192,7 @@ * @return codetrue/code if the String is empty or null */ public static boolean isEmpty(String str) { -return (str == null || str.length() == 0); +return str == null || str.length() == 0; } /** @@ -210,7 +210,7 @@ * @return codetrue/code if the String is not empty and not null */ public static boolean isNotEmpty(String str) { -return (str != null str.length() 0); +return str != null str.length() 0; } /** @@ -292,7 +292,7 @@ * Method will be removed in Commons Lang 3.0. */ public static String clean(String str) { -return (str == null ? EMPTY : str.trim()); +return str == null ? EMPTY : str.trim(); } /** @@ -319,7 +319,7 @@ * @return the trimmed string, codenull/code if null String input */ public static String trim(String str) { -return (str == null ? null : str.trim()); +return str == null ? null : str.trim(); } /** @@ -346,7 +346,7 @@ */ public static String trimToNull(String str) { String ts = trim(str); -return (isEmpty(ts) ? null : ts); +return isEmpty(ts) ? null : ts; } /** @@ -371,7 +371,7 @@ * @since 2.0 */ public static String trimToEmpty(String str) { -return (str == null ? EMPTY : str.trim()); +return str == null ? EMPTY : str.trim(); } // Stripping @@ -4397,7 +4397,7 @@ * was codenull/code */ public static String defaultString(String str) { -return (str == null ? EMPTY : str); +return str == null ? EMPTY : str; } /** @@ -4418,7 +4418,7 @@ * @return the passed in String, or the default if it was codenull/code */ public static String defaultString(String str, String defaultStr) { -return (str == null ? defaultStr : str); +return str == null ? defaultStr : str; } // Reversing - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [lang] New StringUtils method - defaultIfEmpty
Hi Stephen: It sounds OK but there might be a different (better?) way. We now have trimToEmpty and trimToNull methods. What about a trimToDefault method? Just a thought. Gary -Original Message- From: Stephen Colebourne [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 30, 2005 2:29 PM To: Jakarta Commons Developers List Subject: [lang] New StringUtils method - defaultIfEmpty Currently we have two default methods, both of which default when the string parameter is null. At my job we just had need of a default if empty method: public String defaultIfEmpty(String str, String defaultString) { if (isEmpty(str)) { return defaultString; } else { return str; } } Does this sound OK to add? Stephen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]