Package net.sourceforge.jnlp.config
Class InfrastructureFileDescriptor
- java.lang.Object
-
- net.sourceforge.jnlp.config.InfrastructureFileDescriptor
-
- Direct Known Subclasses:
PathsAndFiles.CacheFileDescriptor,PathsAndFiles.ConfigFileDescriptor,PathsAndFiles.DataFileDescriptor,PathsAndFiles.HomeFileDescriptor,PathsAndFiles.RuntimeFileDescriptor,PathsAndFiles.SystemConfigFileDescriptor,PathsAndFiles.SystemJavaFileDescriptor,PathsAndFiles.TmpUsrFileDescriptor
public class InfrastructureFileDescriptor extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringdescriptionKeyprivate java.lang.StringfileNameprivate java.lang.StringpathStubprivate java.lang.StringsystemPathStub(package private) Target[]target
-
Constructor Summary
Constructors Modifier Constructor Description protectedInfrastructureFileDescriptor()(package private)InfrastructureFileDescriptor(java.lang.String fileName, java.lang.String pathStub, java.lang.String systemPathStub, java.lang.String descriptionKey, Target... target)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Stringclean(java.lang.String s)Remove garbage from paths.java.lang.StringgetDefaultFullPath()java.lang.StringgetDescription()protected java.lang.StringgetDescriptionKey()java.lang.StringgetDirViaAcronym()For documentation purposes, the descriptor may be created as VARIABLE/custom/path.java.io.FilegetFile()protected java.lang.StringgetFileName()java.lang.StringgetFullPath()java.lang.StringgetFullPath(DeploymentConfiguration config)overload version for control panel, which is saving to internal copy.protected java.lang.StringgetPropertiesKey()setup-able files have to override this if they don't, they are read only, and set value will fail if it is desired to write value of property, then override and use known key.private java.lang.StringgetStub()This remaining part of file declaration, when acronym is removed.protected java.lang.StringgetSystemPathStubAcronym()java.net.URLgetUrl()voidsetValue(java.lang.String value)voidsetValue(java.lang.String value, DeploymentConfiguration config)overload version for control panel, which is saving to internal copy.java.lang.StringtoString()
-
-
-
Field Detail
-
fileName
private final java.lang.String fileName
-
pathStub
private final java.lang.String pathStub
-
systemPathStub
private final java.lang.String systemPathStub
-
descriptionKey
private final java.lang.String descriptionKey
-
target
final Target[] target
-
-
Constructor Detail
-
InfrastructureFileDescriptor
protected InfrastructureFileDescriptor()
-
InfrastructureFileDescriptor
InfrastructureFileDescriptor(java.lang.String fileName, java.lang.String pathStub, java.lang.String systemPathStub, java.lang.String descriptionKey, Target... target)
-
-
Method Detail
-
getPropertiesKey
protected java.lang.String getPropertiesKey()
setup-able files have to override this if they don't, they are read only, and set value will fail if it is desired to write value of property, then override and use known key.- Returns:
- null by default. Should return key to configuration if overridden.
-
getFile
public java.io.File getFile()
-
getUrl
public java.net.URL getUrl() throws java.net.MalformedURLException- Throws:
java.net.MalformedURLException
-
setValue
public void setValue(java.lang.String value)
-
getFullPath
public java.lang.String getFullPath()
-
setValue
public void setValue(java.lang.String value, DeploymentConfiguration config)overload version for control panel, which is saving to internal copy.- Parameters:
value- new path of fileconfig- config where t write this value (note, usually JNLPRuntime.getConfiguration() so you don't need it, but our config gui tool is using two sets to allow undo.
-
getFullPath
public java.lang.String getFullPath(DeploymentConfiguration config)
overload version for control panel, which is saving to internal copy.- Parameters:
config- config from where to read this value (note, usually JNLPRuntime.getConfiguration() so you don't need it, but our config gui tool is using two sets to allow undo.- Returns:
- configured property or default
-
getDefaultFullPath
public java.lang.String getDefaultFullPath()
-
getSystemPathStubAcronym
protected java.lang.String getSystemPathStubAcronym()
-
getFileName
protected java.lang.String getFileName()
-
getDescriptionKey
protected java.lang.String getDescriptionKey()
-
getStub
private java.lang.String getStub()
This remaining part of file declaration, when acronym is removed. See getDirViaAcronym.- Returns:
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getDirViaAcronym
public java.lang.String getDirViaAcronym()
For documentation purposes, the descriptor may be created as VARIABLE/custom/path.This is whole part, which is considered as setup-able.
- Returns:
- directory acronym for nice docs
-
clean
protected java.lang.String clean(java.lang.String s)
Remove garbage from paths.Currently this methods unify all multiple occurrences of separators to single one. Eg /path/to//file will become /path/to/file.
Those artifacts maybe spread during various s=path+separator+subdir+separator file=s+separator+filename
- Parameters:
s- string to be cleaned- Returns:
- cleaned string
-
getDescription
public java.lang.String getDescription()
- Returns:
- the translated description
-
-