cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieving a text file from BO server and displaying it in browser

Former Member
0 Kudos

Hi Friends,

We have a requirement wherein we are storing text files in BO server and need to retrieve them using BO SDK and display it in browser. These text files are not generated by BO server but from other system. We just need to store them in BO server and retrieve them using BO java SDK.

We got struck in retrieving the textfile from BO server. Please let us know how we can do this.

Appreciate your help.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Here is some code I used in R2 to read text files (haven't tried it in 3.x). I omitted querying for the text file IInfoObject:

IInfoObject file = ...
IContent optionsFile = (IContent) file;
BufferedReader input = new BufferedReader(new InputStreamReader(optionsFile.getInputStream()));

try{
	String line = null;
	while((line = input.readLine()) != null){
		System.out.println(line);
	}
}
catch(IOException e){
	System.out.println("There was an error reading the file");
}
finally{
	try{
		input.close();
	}
	catch(IOException e){
		System.out.println("Could not close optinos file");
		input = null;
	}
}

Former Member
0 Kudos

Hi Ryan,

Thanks for the reply. Could you please include querying for the text file IInfoObject also.

It would be more helpful to understand the whole thing.

Former Member
0 Kudos

There are several ways to query for the object. I also have utility methods that hide the retrieval process so I'm going from memory:

String query = "select * from ci_infoobjects where si_id = <object ID>";
IInfoObject file = (IInfoObject)infoStore.query(query).get(0);
...

Former Member
0 Kudos

Hi Ryan,

Thanks a lot for your help. Its working.

Answers (0)