Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » IFile
IFile [message #20022] Mon, 28 April 2003 15:51 Go to next message
Eclipse UserFriend
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 #20467 is a reply to message #20022] Mon, 28 April 2003 16:25 Go to previous messageGo to next message
Kevin Clark is currently offline Kevin ClarkFriend
Messages: 4
Registered: July 2009
Junior Member
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
Re: IFile [message #20478 is a reply to message #20467] Mon, 28 April 2003 17:02 Go to previous message
Eclipse UserFriend
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
Previous Topic:shared launch configuration
Next Topic:Hiding external JARs in project view
Goto Forum:
  


Current Time: Thu Dec 26 12:29:20 GMT 2024

Powered by FUDForum. Page generated in 0.02687 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top