|
Forge - Shell API 1.2.0.Final | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.forge.resources.AbstractResource<File>
org.jboss.forge.resources.FileResource<PropertiesFileResource>
org.jboss.forge.resources.PropertiesFileResource
public class PropertiesFileResource
A property based resource
| Field Summary |
|---|
| Fields inherited from class org.jboss.forge.resources.FileResource |
|---|
file, lastModification, scratch, scratchFile |
| Fields inherited from class org.jboss.forge.resources.AbstractResource |
|---|
flags, parent, resourceFactory |
| Constructor Summary | |
|---|---|
PropertiesFileResource(ResourceFactory factory)
|
|
PropertiesFileResource(ResourceFactory factory,
File file)
|
|
| Method Summary | |
|---|---|
Resource<File> |
createFrom(File file)
Create a new Resource instance for the target file. |
protected List<Resource<?>> |
doListResources()
Strategy method for returning child resources. |
Set<String> |
getKeys()
Returns the keys in this properties file |
String |
getProperty(String key)
Returns the value related to the key in this properties file |
void |
putAllProperties(Map<String,String> newProperties)
Adds all the properties and updates the file |
String |
putProperty(String key,
String value)
Adds a property to this resource |
String |
removeProperty(String key)
Removes an entry on this file based on the properties file |
void |
replaceProperties(Map<String,String> newProperties)
Replaces all the occurrences |
String |
toString()
|
| Methods inherited from class org.jboss.forge.resources.FileResource |
|---|
createNewFile, createTempResource, delete, delete, deleteOnExit, exists, getChild, getName, getParent, getResourceInputStream, getUnderlyingResourceObject, isDirectory, isStale, markUpToDate, mkdir, mkdirs, reify, renameTo, renameTo, setContents, setContents, setContents |
| Methods inherited from class org.jboss.forge.resources.AbstractResource |
|---|
equals, getFlags, getFullyQualifiedName, getResourceFactory, hashCode, isFlagSet, listResources, listResources, setFlag, unsetFlag |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
@Inject public PropertiesFileResource(ResourceFactory factory)
public PropertiesFileResource(ResourceFactory factory,
File file)
| Method Detail |
|---|
public Resource<File> createFrom(File file)
FileResourceResource instance for the target file. The new Resource should be of the same type as
this.
createFrom in interface Resource<File>createFrom in class FileResource<PropertiesFileResource>file - The file to create the resource instance from.
protected List<Resource<?>> doListResources()
AbstractResource
doListResources in class AbstractResource<File>
public String putProperty(String key,
String value)
key - value -
public void putAllProperties(Map<String,String> newProperties)
newProperties - public void replaceProperties(Map<String,String> newProperties)
newProperties - public String removeProperty(String key)
key -
public String getProperty(String key)
key -
public Set<String> getKeys()
public String toString()
toString in class Object
|
Forge - Shell API 1.2.0.Final | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||