Hi Zoran,

My first thought is that you'll need to create a temporary file. If
getURI returns null.
See http://www.exampledepot.com/egs/java.io/CreateTempFile.html

Hope this helps.

On Fri, Apr 18, 2008 at 12:15 PM, Zoran Jeremic <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I have created ArgoUML plugin which has to send ArgoUML project to the
> remote repository on FTP server. All data, such as url, file name etc.
> should be provided by the system itself, so user should not use JFileChooser
> to select location. He only has to selects menu item and the project will be
> uploaded to the default location with default file name. I have created the
> following code:
>
>  URI uri = ProjectManager.getManager().getCurrentProject().getURI();
>         if(uri==null){
>            //some code should be added here
>         }
>         File file = new File(uri);
>             if (file == null) {
>                 return;
>             }
>         FTPConnectionManager ftpConnMan=new FTPConnectionManager();
>         ftpConnMan.createConnectionToFTPServer("127.0.0.1", "test", "");
>         ftpConnMan.uploadFileToRepository(file,"myTestProjectFile.zargo");
>         ftpConnMan.closeConnection();
>
> It works if I use project which already exists or is saved localy before
> sending. However, if I create new project and try to send it, it doesn't
> have URI so the file is not created. As my FTP client works with
> java.io.File, I need an instance of this class to get from current project.
>
> I suppose that is easy question for you.
> Thanks in advance.
>
> Zoran
>
>  ________________________________
>
> Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it
> now.



-- 
Regards,

Christian López Espínola

Reply via email to