Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,67 @@

public class FileBasedConfigurationManagerImpl extends FileBasedConfigurationManager {

private static FileBasedConfigurationManager fileBasedConfigurationManager;

private FileBasedConfigurationManagerImpl(){
}

@Override
public String getConfiguration(String key) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'getConfiguration'");
if(properties.containsKey(key)) return properties.getProperty(key);
return null;
}

@Override
public <T> T getConfiguration(String key, Class<T> type) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'getConfiguration'");
String value=properties.getProperty(key);
T ans=null;
if(value!=null){
ans=convert(value,type);
}
return ans;
}

@Override
public void setConfiguration(String key, String value) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'setConfiguration'");
properties.setProperty(key,value);
}

@Override
public <T> void setConfiguration(String key, T value) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'setConfiguration'");
properties.setProperty(key,(String)value);
}

@Override
public void removeConfiguration(String key) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'removeConfiguration'");
properties.remove(key);
}

@Override
public void clear() {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'clear'");
properties.clear();
}

public static FileBasedConfigurationManager getInstance() {
// TODO Auto-generated method stub
return null;
if(fileBasedConfigurationManager==null){
synchronized (FileBasedConfigurationManagerImpl.class){
if(fileBasedConfigurationManager==null){
fileBasedConfigurationManager=new FileBasedConfigurationManagerImpl();
}
}
}
return fileBasedConfigurationManager;
}

public static void resetInstance() {
// TODO Auto-generated method stub
fileBasedConfigurationManager=null;
}

}