XML Deployment Adapters

com.exln.stylus.io
Interface StylusFileSystemOptions

All Superinterfaces:
StylusFileSystem

public interface StylusFileSystemOptions
extends StylusFileSystem

Optional methods for a Stylus Studio custom file system.
A class which implements StylusFileSystem may implement one or more of the methods in this interface. The class should not implement this interface, as new methods may be added to it from time to time. It is sufficient to provide implementations for one or more of these methods in the StylusFileSystem class. Stylus Studio will only call the methods that are present.


Method Summary
 boolean deleteItem(String path)
          Delete a file within the custom file system.
 String getAdditionalFileExtension()
          Get an additional file extension for this custom file system.
 String getDefaultFileExtension()
          Get the default file extension for this custom file system.
 boolean supportsCaseSensitivePathNames()
          Return whether pathnames in this custom file system are case sensitive.
 boolean supportsDelete()
          Return whether this custom file system can delete files.
 
Methods inherited from interface com.exln.stylus.io.StylusFileSystem
buildDirectoryStructure, canChangeServers, canCreateDirectories, connectServer, disconnectServer, exists, getCurrentDirectory, getFileClassName, getName, getScheme, getSeparator, getServerName, getURLForPathName, getVersion, isAbsolute, isDirectory, isPathValid, listRoots, matchesScheme, mkdir, renameTo, resolveShortcuts, setCurrentDirectory, supportsDirectories, supportServer
 

Method Detail

supportsCaseSensitivePathNames

public boolean supportsCaseSensitivePathNames()
Return whether pathnames in this custom file system are case sensitive. If this method is not present, Stylus Studio will assume false.

Returns:
true if pathnames are case sensitive.

getDefaultFileExtension

public String getDefaultFileExtension()
Get the default file extension for this custom file system.

Stylus Studio gets a list of files from this custom file system by calling StylusFile.listFiles(). It filters the resulting list and displays (to the user) only those files which have appropriate extensions, such as .xml, .xsl, etc. If the files stored in this custom file system use a different file extension, they will be filtered and the user won't see them. The two methods getDefaultFileExtension() and getAdditionalFileExtension() allow a custom file system to circumvent this filter.

To do this, you code getDefaultFileExtension to return a string containing the extension that is the natural extension used by the custom file system, and you code getAdditionalFileExtension to return a string containing the extension that Stylus Studio is expecting. This tells Stylus Studio that the two extensions are functionally equivalent and files with either one should be accepted and shown to the user.

For example, the SQL Relational DB file system returns files with the extension .rdbxml for use as .xml files by Stylus Studio. It has this code:

	String getDefaultFileExtension() { return ".rdbxml"; }
	String getAdditionalFileExtension() { return ".xml"; }
 

Returns:
The default file extension as a lower-case string beginning with a ".", for example ".rdbxml".

getAdditionalFileExtension

public String getAdditionalFileExtension()
Get an additional file extension for this custom file system.

Returns:
A string with a file extension, in the same format as getDefaultFileExtension().
See Also:
getDefaultFileExtension()

supportsDelete

public boolean supportsDelete()
Return whether this custom file system can delete files. If this method is not present, Stylus Studio will assume false. If this method is present and returns true, then the File->Open and File->SaveAs dialogs will present an interface that allows the user to delete files in the custom file system.

Returns:
true if it can delete files.

deleteItem

public boolean deleteItem(String path)
Delete a file within the custom file system.

Parameters:
path - The name of the file to be deleted.
Returns:
true if the delete was successful.


XML Deployment Adapters