IFile [message #20022] |
Mon, 28 April 2003 15:51 |
Eclipse User |
|
|
|
Originally posted by: pebraert.vub.ac.be
Hello,
I want to set the contents of a file. The inputs I am using come from an
Eclipse editor, and are a String.
The Interface org.eclipse.core.resources.IFile only provides a method that
takes an InputStream as a paramer for setting the contents of a file.
Problem is that String InputStreams are deprecated. According to my java
API, we should use StringReader from now on.
So...
Is there a way to change a StringReader to a InputStream?
or...
Is there another way to change this problem?
Maybe expanding the IFile Interface with a method that takes a
StringReader as an input?
Thanks,
Peter
|
|
|
|
Re: IFile [message #20478 is a reply to message #20467] |
Mon, 28 April 2003 17:02 |
Eclipse User |
|
|
|
Originally posted by: pebraert.vub.ac.be
Yeah, that did the job...
Thanks,
Peter
Kevbo wrote:
> I think what you want to do is break the string into a byte array. Then
> create a ByteArrayInputStream. Use that to setContents(InputStream, int,
> IProgressMonitor).
> Peter Ebraert wrote:
> > Hello,
> > I want to set the contents of a file. The inputs I am using come from an
> > Eclipse editor, and are a String.
> > The Interface org.eclipse.core.resources.IFile only provides a method that
> > takes an InputStream as a paramer for setting the contents of a file.
> > Problem is that String InputStreams are deprecated. According to my java
> > API, we should use StringReader from now on.
> > So...
> > Is there a way to change a StringReader to a InputStream?
> > or...
> > Is there another way to change this problem?
> > Maybe expanding the IFile Interface with a method that takes a
> > StringReader as an input?
> > Thanks,
> > Peter
|
|
|
Powered by
FUDForum. Page generated in 0.02687 seconds