Search in sources :

Example 1 with PublishingProfile

use of com.microsoft.azure.toolkit.lib.appservice.model.PublishingProfile in project azure-tools-for-java by microsoft.

the class FtpCredentialsWindow method createDialogArea.

/**
 * Create contents of the dialog.
 *
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
    setTitle("FTP Credentials");
    setMessage("Web App '" + webApp.name() + "' FTP deployment server credentials.");
    Composite area = (Composite) super.createDialogArea(parent);
    Composite container = new Composite(area, SWT.NONE);
    container.setLayout(new GridLayout(2, false));
    container.setLayoutData(new GridData(GridData.FILL_BOTH));
    PublishingProfile pp = webApp.getPublishingProfile();
    Label lblNewLabel = new Label(container, SWT.NONE);
    lblNewLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblNewLabel.setText("Host:");
    textHost = new Text(container, SWT.BORDER);
    textHost.setEditable(false);
    textHost.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    textHost.setText(pp.getFtpUrl());
    Label lblUserName = new Label(container, SWT.NONE);
    lblUserName.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblUserName.setText("Username:");
    textUsername = new Text(container, SWT.BORDER);
    textUsername.setEditable(false);
    textUsername.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    textUsername.setText(pp.getFtpUsername());
    Label lblNewLabel_1 = new Label(container, SWT.NONE);
    lblNewLabel_1.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblNewLabel_1.setText("Password:");
    textPassword = new Text(container, SWT.BORDER);
    textPassword.setEditable(false);
    textPassword.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    textPassword.setText(pp.getFtpPassword());
    return area;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) PublishingProfile(com.microsoft.azure.toolkit.lib.appservice.model.PublishingProfile)

Example 2 with PublishingProfile

use of com.microsoft.azure.toolkit.lib.appservice.model.PublishingProfile in project azure-tools-for-java by Microsoft.

the class FtpCredentialsWindow method createDialogArea.

/**
 * Create contents of the dialog.
 *
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
    setTitle("FTP Credentials");
    setMessage("Web App '" + webApp.name() + "' FTP deployment server credentials.");
    Composite area = (Composite) super.createDialogArea(parent);
    Composite container = new Composite(area, SWT.NONE);
    container.setLayout(new GridLayout(2, false));
    container.setLayoutData(new GridData(GridData.FILL_BOTH));
    PublishingProfile pp = webApp.getPublishingProfile();
    Label lblNewLabel = new Label(container, SWT.NONE);
    lblNewLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblNewLabel.setText("Host:");
    textHost = new Text(container, SWT.BORDER);
    textHost.setEditable(false);
    textHost.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    textHost.setText(pp.getFtpUrl());
    Label lblUserName = new Label(container, SWT.NONE);
    lblUserName.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblUserName.setText("Username:");
    textUsername = new Text(container, SWT.BORDER);
    textUsername.setEditable(false);
    textUsername.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    textUsername.setText(pp.getFtpUsername());
    Label lblNewLabel_1 = new Label(container, SWT.NONE);
    lblNewLabel_1.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblNewLabel_1.setText("Password:");
    textPassword = new Text(container, SWT.BORDER);
    textPassword.setEditable(false);
    textPassword.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    textPassword.setText(pp.getFtpPassword());
    return area;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) PublishingProfile(com.microsoft.azure.toolkit.lib.appservice.model.PublishingProfile)

Example 3 with PublishingProfile

use of com.microsoft.azure.toolkit.lib.appservice.model.PublishingProfile in project azure-tools-for-java by Microsoft.

the class TunnelProxy method reset.

public void reset() {
    String host = appService.hostName().toLowerCase().replace("http://", "").replace("https://", "");
    String[] parts = host.split("\\.", 2);
    host = Joiner.on('.').join(parts[0], "scm", parts[1]);
    PublishingProfile publishingProfile = appService.getPublishingProfile();
    wssProxy = new WebSocketSSLProxy(String.format("wss://%s/AppServiceTunnel/Tunnel.ashx", host), publishingProfile.getGitUsername(), publishingProfile.getGitPassword());
}
Also used : PublishingProfile(com.microsoft.azure.toolkit.lib.appservice.model.PublishingProfile) WebSocketSSLProxy(com.microsoft.azure.toolkit.lib.common.utils.WebSocketSSLProxy)

Example 4 with PublishingProfile

use of com.microsoft.azure.toolkit.lib.appservice.model.PublishingProfile in project azure-maven-plugins by microsoft.

the class DeployExternalResourcesTask method deployExternalResources.

private void deployExternalResources(final IAppService<?> target, final List<DeploymentResource> resources) {
    if (resources.isEmpty()) {
        return;
    }
    AzureMessager.getMessager().info(AzureString.format("Uploading resources to %s", target.name()));
    final PublishingProfile publishingProfile = target.getPublishingProfile();
    final String serverUrl = publishingProfile.getFtpUrl().split("/", 2)[0];
    try {
        final FTPClient ftpClient = FTPUtils.getFTPClient(serverUrl, publishingProfile.getFtpUsername(), publishingProfile.getFtpPassword());
        for (final DeploymentResource externalResource : resources) {
            uploadResource(externalResource, ftpClient);
        }
    } catch (IOException e) {
        throw new AzureToolkitRuntimeException(e.getMessage(), e);
    }
}
Also used : DeploymentResource(com.microsoft.azure.maven.model.DeploymentResource) AzureToolkitRuntimeException(com.microsoft.azure.toolkit.lib.common.exception.AzureToolkitRuntimeException) AzureString(com.microsoft.azure.toolkit.lib.common.bundle.AzureString) IOException(java.io.IOException) PublishingProfile(com.microsoft.azure.toolkit.lib.appservice.model.PublishingProfile) FTPClient(org.apache.commons.net.ftp.FTPClient)

Example 5 with PublishingProfile

use of com.microsoft.azure.toolkit.lib.appservice.model.PublishingProfile in project azure-tools-for-java by microsoft.

the class TunnelProxy method reset.

public void reset() {
    String host = appService.hostName().toLowerCase().replace("http://", "").replace("https://", "");
    String[] parts = host.split("\\.", 2);
    host = Joiner.on('.').join(parts[0], "scm", parts[1]);
    PublishingProfile publishingProfile = appService.getPublishingProfile();
    wssProxy = new WebSocketSSLProxy(String.format("wss://%s/AppServiceTunnel/Tunnel.ashx", host), publishingProfile.getGitUsername(), publishingProfile.getGitPassword());
}
Also used : PublishingProfile(com.microsoft.azure.toolkit.lib.appservice.model.PublishingProfile) WebSocketSSLProxy(com.microsoft.azure.toolkit.lib.common.utils.WebSocketSSLProxy)

Aggregations

PublishingProfile (com.microsoft.azure.toolkit.lib.appservice.model.PublishingProfile)5 WebSocketSSLProxy (com.microsoft.azure.toolkit.lib.common.utils.WebSocketSSLProxy)2 GridData (org.eclipse.swt.layout.GridData)2 GridLayout (org.eclipse.swt.layout.GridLayout)2 Composite (org.eclipse.swt.widgets.Composite)2 Label (org.eclipse.swt.widgets.Label)2 Text (org.eclipse.swt.widgets.Text)2 DeploymentResource (com.microsoft.azure.maven.model.DeploymentResource)1 AzureString (com.microsoft.azure.toolkit.lib.common.bundle.AzureString)1 AzureToolkitRuntimeException (com.microsoft.azure.toolkit.lib.common.exception.AzureToolkitRuntimeException)1 IOException (java.io.IOException)1 FTPClient (org.apache.commons.net.ftp.FTPClient)1