Java Doc for MergePath.java in  » EJB-Server-resin-3.1.5 » resin » com » caucho » vfs » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » EJB Server resin 3.1.5 » resin » com.caucho.vfs 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.caucho.vfs.MergePath

MergePath
public class MergePath extends FilesystemPath (Code)
A merging of several Paths used like a CLASSPATH. When the MergePath is opened for read, the first path in the list which contains the file will be the opened file. When the MergePath is opened for write, the first path in the list is used for the write.

In the following example, "first" has priority over "second". If test.xml exists in both "first" and "second", the open will return "first/test.xml".

 MergePage merge = new MergePath();
 merge.addMergePath(Vfs.lookup("first");
 merge.addMergePath(Vfs.lookup("second");
 Path path = merge.lookup("test.xml");
 ReadStream is = path.openRead();
 

MergePath corresponds to the "merge:" Vfs schema

 Path path = Vfs.lookup("merge:(../custom-foo;foo)");
 

since:
   Resin 1.2
since:
   Resin 3.0.10 merge: schema



Constructor Summary
public  MergePath()
     Creates a new merge path.

Method Summary
public  voidaddClassPath()
     Adds the classpath as paths in the MergePath.
public  voidaddClassPath(ClassLoader loader)
     Adds the classpath for the loader as paths in the MergePath.
public  voidaddClassPath(String classpath)
     Adds the classpath for the loader as paths in the MergePath.
public  voidaddLocalClassPath()
     Adds the classpath as paths in the MergePath.
public  voidaddLocalClassPath(ClassLoader loader)
     Adds the classpath for the loader as paths in the MergePath.
public  voidaddMergePath(Path path)
     Adds a new path to the end of the merge path.
public  voidaddResourceClassPath(ClassLoader loader)
     Adds the classpath for the loader as paths in the MergePath.
public  booleancanRead()
     Returns true if the best path can be read.
public  booleancanWrite()
     Returns true if the best path can be written to.
public  PersistentDependencycreateDepend()
     Creates a dependency.
public  booleanexists()
     True if any file matching this path exists.
public  PathfsWalk(String userPath, Map<String, Object> attributes, String path)
     Walking down the path just extends the path.
public  PathgetBestPath()
     Returns the first matching path.
public  StringgetFullPath()
     Returns the full path name of the best path.
public  longgetLastModified()
     Returns the last modified time of the best path.
public  longgetLength()
     Returns the length of the best path.
public  ArrayList<Path>getMergePaths()
     Return the list of paths searched in the merge path.
public  StringgetNativePath()
     Returns the full native path name of the best path.
public  StringgetRelativePath()
     Returns the relative path into the merge path.
public  ArrayList<Path>getResources(String pathName)
     Returns all the resources matching the path.
public  ArrayList<Path>getResources()
     Returns all the resources matching the path.
public  StringgetScheme()
     Returns the scheme of the best path.
public  StringgetURL()
     Returns the URL of the best path.
public  PathgetWritePath()
     Returns the first matching path.
public  booleanisDirectory()
     True if the best path is a directory.
public  booleanisFile()
     True if the best path is a file.
public  String[]list()
     List the merged directories.
public  booleanmkdir()
    
public  booleanmkdirs()
    
public  StreamImplopenAppendImpl()
     Opens the best path for appending.
public  StreamImplopenReadImpl()
     Opens the best path for reading.
public  StreamImplopenReadWriteImpl()
     Opens the best path for reading and writing.
public  StreamImplopenWriteImpl()
     Opens the best path for writing.
public  booleanremove()
     Remove the matching path.
public  booleanrenameTo(Path path)
     Renames the path.
protected  PathschemeWalk(String userPath, Map<String, Object> attributes, String filePath, int offset)
    
public  StringtoString()
    


Constructor Detail
MergePath
public MergePath()(Code)
Creates a new merge path.




Method Detail
addClassPath
public void addClassPath()(Code)
Adds the classpath as paths in the MergePath.



addClassPath
public void addClassPath(ClassLoader loader)(Code)
Adds the classpath for the loader as paths in the MergePath.
Parameters:
  loader - class loader whose classpath should be used to search.



addClassPath
public void addClassPath(String classpath)(Code)
Adds the classpath for the loader as paths in the MergePath.
Parameters:
  classpath - class loader whose classpath should be used to search.



addLocalClassPath
public void addLocalClassPath()(Code)
Adds the classpath as paths in the MergePath.



addLocalClassPath
public void addLocalClassPath(ClassLoader loader)(Code)
Adds the classpath for the loader as paths in the MergePath.
Parameters:
  loader - class loader whose classpath should be used to search.



addMergePath
public void addMergePath(Path path)(Code)
Adds a new path to the end of the merge path.
Parameters:
  path - the new path to search



addResourceClassPath
public void addResourceClassPath(ClassLoader loader)(Code)
Adds the classpath for the loader as paths in the MergePath.
Parameters:
  loader - class loader whose classpath should be used to search.



canRead
public boolean canRead()(Code)
Returns true if the best path can be read.



canWrite
public boolean canWrite()(Code)
Returns true if the best path can be written to.



createDepend
public PersistentDependency createDepend()(Code)
Creates a dependency.



exists
public boolean exists()(Code)
True if any file matching this path exists.



fsWalk
public Path fsWalk(String userPath, Map<String, Object> attributes, String path)(Code)
Walking down the path just extends the path. It won't be evaluated until opening.



getBestPath
public Path getBestPath()(Code)
Returns the first matching path.



getFullPath
public String getFullPath()(Code)
Returns the full path name of the best path.



getLastModified
public long getLastModified()(Code)
Returns the last modified time of the best path.



getLength
public long getLength()(Code)
Returns the length of the best path.



getMergePaths
public ArrayList<Path> getMergePaths()(Code)
Return the list of paths searched in the merge path.



getNativePath
public String getNativePath()(Code)
Returns the full native path name of the best path.



getRelativePath
public String getRelativePath()(Code)
Returns the relative path into the merge path.



getResources
public ArrayList<Path> getResources(String pathName)(Code)
Returns all the resources matching the path.



getResources
public ArrayList<Path> getResources()(Code)
Returns all the resources matching the path.



getScheme
public String getScheme()(Code)
Returns the scheme of the best path.



getURL
public String getURL()(Code)
Returns the URL of the best path.



getWritePath
public Path getWritePath()(Code)
Returns the first matching path.



isDirectory
public boolean isDirectory()(Code)
True if the best path is a directory.



isFile
public boolean isFile()(Code)
True if the best path is a file.



list
public String[] list() throws IOException(Code)
List the merged directories.



mkdir
public boolean mkdir() throws IOException(Code)
XXX: Probably should mkdir in the first path



mkdirs
public boolean mkdirs() throws IOException(Code)
XXX: Probably should mkdir in the first path



openAppendImpl
public StreamImpl openAppendImpl() throws IOException(Code)
Opens the best path for appending. XXX: If the best path doesn't exist, this should probably create the file in the first path.



openReadImpl
public StreamImpl openReadImpl() throws IOException(Code)
Opens the best path for reading.



openReadWriteImpl
public StreamImpl openReadWriteImpl() throws IOException(Code)
Opens the best path for reading and writing. XXX: If the best path doesn't exist, this should probably create the file in the first path.



openWriteImpl
public StreamImpl openWriteImpl() throws IOException(Code)
Opens the best path for writing. XXX: If the best path doesn't exist, this should probably create the file in the first path.



remove
public boolean remove() throws IOException(Code)
Remove the matching path.



renameTo
public boolean renameTo(Path path) throws IOException(Code)
Renames the path.



schemeWalk
protected Path schemeWalk(String userPath, Map<String, Object> attributes, String filePath, int offset)(Code)
schemeWalk is called by Path for a scheme lookup like file:/tmp/foo
Parameters:
  userPath - the user's lookup() path
Parameters:
  attributes - the user's attributes
Parameters:
  filePath - the actual lookup() path
Parameters:
  offset - offset into filePath



toString
public String toString()(Code)
Returns a name for the path



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.