Showing posts with label IO. Show all posts
Showing posts with label IO. Show all posts

Thursday, 20 August 2015



Code snippet:

URI resolvedFile = CommonPlugin.resolve(uri);
String fileString = resolvedFile.toFileString();
File file = new File(fileString);

Thats it. You have got the File now.

org.eclipse.emf.common.CommonPlugin - Include this in your import and manifest.

Thursday, 16 April 2015

Code Snippets which is used to convert a text file inside a Eclipse RCP to a String.

Create a PluginResourceToString object and make a call to convertToString method with the filePath as the argument.

If in your plugin, resources is the directory containing text files to be read, and if the name of the text file is example.text. The parameter should be resources/example.text. Make sure that you are including the resources in build.properties file.

Related web links:
  1. StackOverFlow - Simplest way to read a file in to string
  2. StackOverFlow - Convert InputStream in to String


Gallery

Object Oritented, Git

Most Commented

OOAD

Contact Form

Name

Email *

Message *

2014 © Planer - Responsive Blogger Magazine Theme
Planer theme by Way2themes