public class FileTypeAssociation
extends java.lang.Object
Constructor and Description |
---|
FileTypeAssociation(java.lang.String extension)
Creates a class instance for associating files of the specified type.
|
Modifier and Type | Method and Description |
---|---|
void |
createAssociation(java.io.File executable,
java.lang.String progID)
Creates a file type association.
|
void |
createAssociation(java.lang.String commandLine,
java.lang.String progID)
Creates a file type association.
|
java.lang.String |
getDefaultCommand()
Returns the default executable command for the file extension.
|
java.lang.String |
getExtension()
Returns the file extension.
|
java.lang.String |
getProgID()
Returns the program identifier of the default executable program.
|
boolean |
isRegistered()
Returns
true if a file type association for the specified extension is registered. |
void |
removeAssociation()
Removes all associations for the file extension.
|
public FileTypeAssociation(java.lang.String extension)
extension
- specifies the file type by its extension.public void createAssociation(java.io.File executable, java.lang.String progID)
executable
- an associated file will be passed as a parameter of this executable file.progID
- the program identifier in the registry. If the specified program identifier does not exist, it
will be created.public void createAssociation(java.lang.String commandLine, java.lang.String progID)
commandLine
- specifies an executable command.progID
- the executable program identifier in the registry. If the specified program identifier does not exist, it
will be created.public void removeAssociation()
public java.lang.String getDefaultCommand()
public java.lang.String getProgID()
public boolean isRegistered()
true
if a file type association for the specified extension is registered.true
if a file type association for the specified extension is registered.public java.lang.String getExtension()