Skip to content

Commit

Permalink
fixes from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
nlake44 committed Mar 19, 2015
1 parent eafba39 commit c07475f
Showing 1 changed file with 9 additions and 8 deletions.
Expand Up @@ -54,6 +54,7 @@ public class DevAppServerMain
private String appscale_version;
private String admin_console_version;
private static final String PORT_FILE_PREFIX = "/etc/appscale/port-";
private static final String SECRET_LOCATION = "/etc/appscale/secret.key";

private final List<Option> PARSERS = buildOptions(this);
private static final String PREFIX = "When generating a war directory,";
Expand Down Expand Up @@ -213,11 +214,11 @@ private static String getNginxPort()
{
String appName = System.getProperty("APP_NAME");
String portString = null;
BufferedReader br = null;
BufferedReader bufferReader = null;
try
{
br = new BufferedReader(new FileReader(PORT_FILE_PREFIX + appName + ".txt"));
portString = br.readLine();
bufferReader = new BufferedReader(new FileReader(PORT_FILE_PREFIX + appName + ".txt"));
portString = bufferReader.readLine();
}
catch(IOException e)
{
Expand All @@ -228,7 +229,7 @@ private static String getNginxPort()
{
try
{
if (br != null)br.close();
if (bufferReader != null) bufferReader.close();
}
catch (IOException ex)
{
Expand Down Expand Up @@ -419,11 +420,11 @@ public void apply()
// Set the AppScale secret.
private void setSecret()
{
BufferedReader br = null;
BufferedReader bufferReader = null;
try
{
br = new BufferedReader(new FileReader("/etc/appscale/secret.key"));
String value = br.readLine();
bufferReader = new BufferedReader(new FileReader(SECRET_LOCATION));
String value = bufferReader.readLine();
System.setProperty("COOKIE_SECRET", value);
}
catch(IOException e)
Expand All @@ -435,7 +436,7 @@ private void setSecret()
{
try
{
if (br != null) br.close();
if (bufferReader != null) bufferReader.close();
}
catch (IOException ex)
{
Expand Down

0 comments on commit c07475f

Please sign in to comment.