Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Commit

Permalink
This release updates the latest Elastic Beanstalk solution stack name…
Browse files Browse the repository at this point in the history
… for Apache Tomcat 7 and also enables "Amazon Web Services" submenu under Java perspective.
  • Loading branch information
hanshuo-aws committed Jul 3, 2014
1 parent 0f9d1c9 commit da7b000
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
15 changes: 8 additions & 7 deletions com.amazonaws.eclipse.elasticbeanstalk/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,14 @@
<visibleWhen checkEnabled="false">
<with variable="selection">
<iterate ifEmpty="false">
<instanceof value="org.eclipse.core.resources.IResource"/>
<test forcePluginActivation="true"
property="org.eclipse.wst.common.project.facet.core.projectFacet"
value="jst.java"/>
<test forcePluginActivation="true"
property="org.eclipse.wst.common.project.facet.core.projectFacet"
value="jst.web"/>
<adapt type="org.eclipse.core.resources.IProject">
<test forcePluginActivation="true"
property="org.eclipse.wst.common.project.facet.core.projectFacet"
value="jst.java"/>
<test forcePluginActivation="true"
property="org.eclipse.wst.common.project.facet.core.projectFacet"
value="jst.web"/>
</adapt>
</iterate>
</with>
</visibleWhen>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

public class SolutionStacks {
private static final String TOMCAT_6_64BIT_AMAZON_LINUX = "64bit Amazon Linux running Tomcat 6";
private static final String TOMCAT_7_64BIT_AMAZON_LINUX = "64bit Amazon Linux 2014.03 v1.0.2 running Tomcat 7 Java 7";
private static final String TOMCAT_7_64BIT_AMAZON_LINUX = "64bit Amazon Linux 2014.03 v1.0.3 running Tomcat 7 Java 7";
public static final String DEFAULT_SOLUTION_STACK = TOMCAT_7_64BIT_AMAZON_LINUX;

public static String lookupSolutionStackByServerTypeId(String serverTypeId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ private void copyEmptyCredentialsFileToProject() throws CoreException {
}

private static String updateSampleContentWithConfiguredProfile(String sampleContent, final AccountInfo selectedAccount) {
final String credFileLocation = AwsToolkitCore.getDefault().getPreferenceStore().getString(
PreferenceConstants.P_CREDENTIAL_PROFILE_FILE_LOCATION);

String paramString;
if (AwsToolkitCore.getDefault().getPreferenceStore().isDefault(
PreferenceConstants.P_CREDENTIAL_PROFILE_FILE_LOCATION)) {
Expand All @@ -210,17 +213,14 @@ private static String updateSampleContentWithConfiguredProfile(String sampleCont

} else {
paramString = String.format("\"%s\", \"%s\"",
AwsToolkitCore.getDefault().getPreferenceStore().getString(
PreferenceConstants.P_CREDENTIAL_PROFILE_FILE_LOCATION),
selectedAccount.getAccountName())
.replace("\\", "\\\\"); // escape backslashes
credFileLocation, selectedAccount.getAccountName());
}

// Change the parameter of the ProfileCredentialsProvider
sampleContent = sampleContent.replace(
"new ProfileCredentialsProvider().getCredentials();",
String.format("new ProfileCredentialsProvider(%s).getCredentials();",
paramString));
escapeBackSlashes(paramString)));

// Remove the block of comment between "Before running the code" and "WARNING"
String COMMNET_TO_REMOVE_REGEX = "(Before running the code:.*?)?Fill in your AWS access credentials.*?(?=WANRNING:)";
Expand All @@ -235,8 +235,7 @@ private static String updateSampleContentWithConfiguredProfile(String sampleCont
// (~/.aws/credentials) ==> (user-specified preference store value)
sampleContent = sampleContent.replace(
"(~/.aws/credentials)",
String.format("(%s)", AwsToolkitCore.getDefault().getPreferenceStore().getString(
PreferenceConstants.P_CREDENTIAL_PROFILE_FILE_LOCATION)));
String.format("(%s)", escapeBackSlashes(credFileLocation)));

return sampleContent;
}
Expand All @@ -261,4 +260,8 @@ public boolean performCancel() {
private void logError(String errMsg, Throwable t) {
AwsToolkitCore.getDefault().logException(errMsg, t);
}

private static String escapeBackSlashes(String str) {
return str.replace("\\", "\\\\");
}
}

0 comments on commit da7b000

Please sign in to comment.