Method Detail

makeRelative

Make the child URL relative to the base URL.
The query and fragment identifier are preserved if the initial reference contains them.

The child URL is relatively expressed to the base URL. If it is
not possible, the child URL is returned.

For example if the base URL is "file://c:/projects/exml/base.prx" and the child
URL is "file://c:/projects/exml/test/someTest.xml" the result will be: "test/someTest.xml"

Parameters:

baseURL - The base URL.

childURL - The child URL.

Returns:

The relative path or the childURL if a relative path cannot be computed.

correctURL

java.lang.String correctURL(java.lang.String url)

Corrects the given URL by converting not allowed characters to their escaped representation.
The URL correction takes an URL like:
http://path to directory/file.xml
and escapes illegal URL characters like spaces to:
http://path%20to%20directory/file.xml

Parameters:

url - The URL to be corrected.

Returns:

The corrected URL. It does not return null.

uncorrectURL

java.lang.String uncorrectURL(java.lang.String url)

Un-corrects the given URL by converting the percent encoded characters back to the original characters.
The URL un-correction takes an URL like:
http://path%20to%20directory/file.xml
and unescapes it back to:
http://path to directory/file.xml

convertFileToURL

Converts the given file to an URL by converting not allowed characters to their escaped representation.
The URL correction takes a File like:
c:\path to directory\file.xml
and escapes illegal URL characters like spaces to:
http://path%20to%20directory/file.xml

Parameters:

file - The File to be corrected.

Returns:

The corrected URL. It does not return null.

Throws:

java.net.MalformedURLException - if it fails to perform the conversion.

Since:

18

removeUserCredentials

java.net.URL removeUserCredentials(java.net.URL url)

Removes the user name and password from the URL if they are present.

Parameters:

url - The URL from which the user credentials will be removed.

Returns:

The URL having the user credentials removed.

Since:

12.1

locateFile

java.io.File locateFile(java.net.URL url)

Locate the file on disk corresponding to the URL.

Parameters:

url - The URL to be checked.

Returns:

The corresponding File from the local file system
or null if the URL is remote.

getExtension

java.lang.String getExtension(java.net.URL url)

Get the file extension for this URL. The extension is lower cased.

Parameters:

url - The URL to extract the extension for.

Returns:

the file extension for this URL. The extension is lower cased.

getFileName

java.lang.String getFileName(java.lang.String urlPath)

Get the file name from a file or URL path

Parameters:

urlPath - An URL path

Returns:

the file name from a file or URL path

isSupportedImageURL

boolean isSupportedImageURL(java.net.URL url)

Check if this URL points to a supported image. The image extension is used

Parameters:

url - The URL

Returns:

true if this URL points to a supported image. The image extension is used

isUnhandledBinaryResourceURL

boolean isUnhandledBinaryResourceURL(java.net.URL url)

Check if this URL points to a binary resource which is not handled by Oxygen in any way.
The resource file extension is checked against a list of binary file patterns configured in the Oxygen options.
For example ZIP-like archives are handled by Oxygen although they are binary.

Parameters:

url - The URL

Returns:

true if this URL points to a binary resource.

Since:

15

expandEditorVariables

Try to expand the editor variables in a path.
If there's an external framework associated with the current editor, any $framework, $frameworks,
$frameworkDir or $frameworksDir variable will be expanded in the context of
that framework.

Parameters:

pathWithEditorVariables - The path containing editor variables

currentEditedURL - The current edited URL

Returns:

The path with editor variables expanded.

Since:

12.1

encrypt

java.lang.String encrypt(java.lang.String toEncrypt)

Encrypts a string using the Oxygen internal encryption system.
The encryption/decryption is application-specific so a string encrypted in one Oxygen installation cannot be decrypted in another.
You can use this method if you want to store user-specific data on disk with a moderate level of security.

Parameters:

toEncrypt - The string to encrypt.

Returns:

The string encrypted using the Oxygen internal encryption system.

Since:

12.1

decrypt

java.lang.String decrypt(java.lang.String toDecrypt)

Decrypts a string using the Oxygen internal encryption system.
The encryption/decryption is application-specific so a string encrypted in one Oxygen installation cannot be decrypted in another.
You can use this method if you want to store user-specific data on disk with a moderate level of security.

Parameters:

toDecrypt - The string to decrypt.

Returns:

The string decrypted using the Oxygen internal encryption system or NULL if the string format is not understood.

Since:

12.1

addCustomEditorVariablesResolver

Add a custom editor variables resolver.
The resolver receives a string which may or may not contain custom editor variables.
It can either return the unmodified string or a modified version of the string in which certain editor variables have been expanded to certain values.

createReader

Opens a connection for the given URL, examines its contents and decides what kind
of encoding should be used.

Parameters:

url - The URL to be opened.

defaultEncoding - The encoding to be used when all other ways of detecting it returned
null. This is used instead of creating the input stream reader with no encoding arguments. This
is a JAVA encoding.