Package at.bestsolution.drawswf.plugin.remotesave.util

Examples of at.bestsolution.drawswf.plugin.remotesave.util.RemoteSaveConfig


        JPanel field_pane = new JPanel();
        JPanel button_pane = new JPanel(new FlowLayout(FlowLayout.CENTER));
        JPanel root_pane = new JPanel(new BorderLayout());
        JLabel label;
        JButton button;
        RemoteSaveConfig remote_config = RemoteSaveConfig.getInstance();

        field_pane.setLayout(new GridLayout(4, 2));

        label = new JLabel(RemoteSavePlugin.getI18n().getString("RemoteSaveDialogRemoteURI"));
        remote_uri_ = new JTextField(remote_config.getProperty("remote_uri"));

        field_pane.add(label);
        field_pane.add(remote_uri_);

        label = new JLabel(RemoteSavePlugin.getI18n().getString("RemoteSaveDialogRemotePwd"));
        remote_pwd_ = new JTextField(remote_config.getProperty("remote_pwd"));

        field_pane.add(label);
        field_pane.add(remote_pwd_);

        label = new JLabel(RemoteSavePlugin.getI18n().getString("RemoteSaveDialogRemoteUser"));
        remote_user_ = new JTextField(remote_config.getProperty("remote_user"));

        field_pane.add(label);
        field_pane.add(remote_user_);

        label = new JLabel(RemoteSavePlugin.getI18n().getString("RemoteSaveDialogRemoteFileName"));
View Full Code Here


    {
        hide();

        if (e.getActionCommand().equals("Save"))
        {
            RemoteSaveConfig remote_config = RemoteSaveConfig.getInstance();
            remote_config.setProperty("remote_uri", remote_uri_.getText());
            remote_config.setProperty("remote_pwd", remote_pwd_.getText());
            remote_config.setProperty("remote_user", remote_user_.getText());
            saveToRemoteHost(upload_name_.getText());
        }
    }
View Full Code Here

    private void saveToRemoteHost(String filename)
    {
        URL remote_url = null;

        Object[] speed_values = { "1", "2", "3", "4", "5", "10" };
        RemoteSaveConfig remote_config = RemoteSaveConfig.getInstance();

        String selected_value =
            (String) JOptionPane.showInputDialog(null, RemoteSavePlugin.getI18n().getString("RemoteSaveSaveSWFActionTitle"), RemoteSavePlugin.getI18n().getString("RemoteSaveSaveSWFActionTitle"), JOptionPane.INFORMATION_MESSAGE, null, speed_values, speed_values[1]);

        if (selected_value != null)
        {
            int speed = Integer.parseInt(selected_value);

            FlashGenerator generator = new FlashGenerator(RemoteSavePlugin.getDrawingPanel().getCanvasSize(), speed);
            File selected_file = new File(System.getProperty("java.io.tmpdir") + File.separator + filename);
            generator.generateFile(selected_file.getPath(), RemoteSavePlugin.getDrawingPanel().getLines());

            try
            {
                remote_url = new URL(remote_config.getProperty("remote_uri"));
            }
            catch (MalformedURLException e)
            {
                e.printStackTrace();
            }

            MultipartPostMethod file_post = new MultipartPostMethod();

            if (remote_url.getPath() == null)
            {
                file_post.setPath("/");
            }
            else
            {
                file_post.setPath(remote_url.getPath());
            }

            try
            {
                file_post.addParameter("swf", selected_file);
                HttpClient client = new HttpClient();
                client.getState().setCredentials("realm", new UsernamePasswordCredentials(remote_config.getProperty("remote_user"), remote_config.getProperty("remote_pwd")));
                HostConfiguration hc = new HostConfiguration();
                file_post.setDoAuthentication(true);
                hc.setHost(new URI(remote_url));
                client.setHostConfiguration(hc);
                int status = client.executeMethod(file_post);
View Full Code Here

TOP

Related Classes of at.bestsolution.drawswf.plugin.remotesave.util.RemoteSaveConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.