Pbm Opening a file with Streamresouce

Hi guys,

My problem today is that i’m trying to open a ms-word document from a network directory using streamresource but the open file is in read-only mode…

Here is my code:


public static void openDocument(Application ap) 
	{
			
		StreamSource s = new StreamResource.StreamSource(){
            private static final long serialVersionUID = 1L;

			@Override
             public InputStream getStream()
             {
                 try
                 {
                    File f = new File("\\\\172.30.154.6\\mydoc.docx");
                    FileInputStream fis = new FileInputStream(f);
                    return fis;
                }
                catch (Exception e) { e.printStackTrace(); }
            }
        };
        
		                        
		StreamResource r = new StreamResource(s, "mydoc.docx", ap);
		Embedded e = new Embedded();
		e.setType(Embedded.TYPE_BROWSER);
		e.setMimeType("application/msword");
		e.setSource(r);
		e.setWidth("200px");
		e.setHeight("200px");
				
		ap.getMainWindow().open(r, "_blank");
	}

The application should open a Word document, the user do some modifications on it and save it with Word.
Any ideas why my doc is in read-only mode?

Cheers

it works with:

public static void openDocument(Application ap, String url)
{
ExternalResource er = new ExternalResource(url);
ap.getMainWindow().open(er, “_blank”);
}