org.apache.xmlbeans.impl.tool
Class SchemaResourceManager

java.lang.Object
  extended by org.apache.xmlbeans.impl.tool.SchemaImportResolver
      extended by org.apache.xmlbeans.impl.tool.BaseSchemaResourceManager
          extended by org.apache.xmlbeans.impl.tool.SchemaResourceManager

public class SchemaResourceManager
extends BaseSchemaResourceManager


Constructor Summary
SchemaResourceManager(java.io.File directory)
           
 
Method Summary
protected  void deleteFile(java.lang.String filename)
          Deletes a file.
protected  boolean fileExists(java.lang.String filename)
          Returns true if the given filename exists.
protected  java.lang.String[] getAllXSDFilenames()
          Returns a list of all the XSD filesnames in the project.
protected  java.io.InputStream inputStreamForFile(java.lang.String filename)
          Gets the data in the given filename as an InputStream.
static void main(java.lang.String[] args)
           
static void printUsage()
           
protected  void warning(java.lang.String msg)
          Sends messages to System.out.
protected  void writeInputStreamToFile(java.io.InputStream input, java.lang.String filename)
          Writes an entire file in one step.
 
Methods inherited from class org.apache.xmlbeans.impl.tool.BaseSchemaResourceManager
getDefaultSchemaDir, getIndexFilename, init, lookupResource, process, processAll, reportActualNamespace, syncCacheWithLocalXsdFiles, writeCache
 
Methods inherited from class org.apache.xmlbeans.impl.tool.SchemaImportResolver
resolveImports
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaResourceManager

public SchemaResourceManager(java.io.File directory)
Method Detail

printUsage

public static void printUsage()

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Throws:
java.io.IOException

warning

protected void warning(java.lang.String msg)
Sends messages to System.out.

Specified by:
warning in class BaseSchemaResourceManager

fileExists

protected boolean fileExists(java.lang.String filename)
Returns true if the given filename exists. The filenames are of the form "/foo/bar/zee.xsd" and should be construed as rooted at the root of the project.

Specified by:
fileExists in class BaseSchemaResourceManager

inputStreamForFile

protected java.io.InputStream inputStreamForFile(java.lang.String filename)
                                          throws java.io.IOException
Gets the data in the given filename as an InputStream.

Specified by:
inputStreamForFile in class BaseSchemaResourceManager
Throws:
java.io.IOException

writeInputStreamToFile

protected void writeInputStreamToFile(java.io.InputStream input,
                                      java.lang.String filename)
                               throws java.io.IOException
Writes an entire file in one step. An InputStream is passed and copied to the file.

Specified by:
writeInputStreamToFile in class BaseSchemaResourceManager
Throws:
java.io.IOException

deleteFile

protected void deleteFile(java.lang.String filename)
Deletes a file. Sometimes immediately after writing a new file we notice that it's exactly the same as an existing file and we delete it. We never delete a file that was given to us by the user.

Specified by:
deleteFile in class BaseSchemaResourceManager

getAllXSDFilenames

protected java.lang.String[] getAllXSDFilenames()
Returns a list of all the XSD filesnames in the project.

Specified by:
getAllXSDFilenames in class BaseSchemaResourceManager