public class PropertiesFileResource extends FileResource<PropertiesFileResource>
file, lastModification, scratch, scratchFileflags, parent, resourceFactory| Constructor and Description |
|---|
PropertiesFileResource(ResourceFactory factory) |
PropertiesFileResource(ResourceFactory factory,
File file) |
| Modifier and Type | Method and Description |
|---|---|
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() |
createNewFile, createTempResource, delete, delete, deleteOnExit, exists, getChild, getFullyQualifiedName, getName, getParent, getResourceInputStream, getUnderlyingResourceObject, isDirectory, isStale, markUpToDate, mkdir, mkdirs, reify, renameTo, renameTo, setContents, setContents, setContentsequals, getFlags, getResourceFactory, hashCode, isFlagSet, listResources, listResources, setFlag, unsetFlag@Inject public PropertiesFileResource(ResourceFactory factory)
public PropertiesFileResource(ResourceFactory factory, File file)
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()
AbstractResourcedoListResources 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 - Copyright © 2013 JBoss by Red Hat. All Rights Reserved.