reuse (overwrite) existing custom profile file in editing session (id passed in URL)

This commit is contained in:
Norbert Renner 2014-05-22 17:55:17 +02:00
parent 8327fd4e24
commit 5651260691
2 changed files with 20 additions and 4 deletions

View file

@ -26,13 +26,20 @@ public class ProfileUploadHandler
this.serviceContext = serviceContext;
}
public void handlePostRequest(BufferedReader br, BufferedWriter response) throws IOException
public void handlePostRequest(String profileId, BufferedReader br, BufferedWriter response) throws IOException
{
BufferedWriter fileWriter = null;
try
{
String id = "" + System.currentTimeMillis();
String id;
if ( profileId != null )
{
// update existing file when id appended
id = profileId.substring( ProfileUploadHandler.CUSTOM_PREFIX.length() );
} else {
id = "" + System.currentTimeMillis();
}
File file = new File( getOrCreateCustomProfileDir(), id + ".brf" );
fileWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream( file ) ) );
//StringWriter sw = new StringWriter(); bw = new BufferedWriter(sw);