open 1 « Operation « Java I/O Q&A





1. Can IntelliJ IDEA open more than one editor window for files from the same project?    stackoverflow.com

I can split editor panes horizontally or vertically, but it does not seem possible to view code in two separate physical windows. I am aware that Idea can open multiple ...

2. Open a file with an external application on Java    stackoverflow.com

How do you open a file from a java application when you do not know which application the file is associated with. Also, because I'm using Java, I'd prefer a platform ...

3. How to open user system preffered editor for given file?    stackoverflow.com

I'm trying to figure out how to open system preferred editor for given file. Say, we have a file manager, written in Java. User goes to folder and see list of files. ...

4. How to open a file with the default associated program    stackoverflow.com

How do I open a file with the default associated program in Java? (for example a movie file)

5. open temp file in java    stackoverflow.com

I'm writing string to temperoray file(temp.txt) and I want that file should open after clicking button of my awt window it should delete when I close that file (after opening that ...

6. How to open file without extension    stackoverflow.com

I would like to try open file without extension. When I try to open file without extension, then system show me "Open with" form. But when I am trying to open ...

7. Too many open file handles    stackoverflow.com

I'm working on a huge legacy Java application, with a lot of handwritten stuff, which nowadays you'd let a framework handle. The problem I'm facing right now is that we are ...

8. Opening file from Java    stackoverflow.com

What I need is to instruct OS to open the file with the default program used for that file type. Exactly as if, i.e., that file was double-clicked by user under ...

9. Open an external program in Qt with an attached file extension    stackoverflow.com

I am making a qt application which allows the user to select a file and then upon clicking ok, start the associated program with the file already loaded. The program I ...





10. Are there practical limits to the number of open files in Java?    stackoverflow.com

I've built some file sorting functionality into a java app, and it's designed to sort files larger than 20GB. The general approach is to read the file in chunks, sort each ...

11. (JAVA) How open a temp htm file in browser?    stackoverflow.com

I tried this, but without sucess:

         File temp = File.createTempFile("document", ".htm");

         BufferedWriter out = new ...

12. How to open .hprof file    stackoverflow.com

I am running a Java application and faced an error Out of memory. .hprof file is generated. What do I use to analyse what's in the file? How to read that ...

13. How to open a .dat file in java program    stackoverflow.com

I was handed some data in a file with an .dat extension. I need to read this data in a java program and build the data into some objects we defined. ...

14. How to open the notepad file in java?    stackoverflow.com

I want to open the notepad in my java program. Suppose that I have one button if I click this button the notepad will appear. I already have a file name ...

15. How to open rar file in java 1.4    stackoverflow.com

I guess ZipFile doesn't supprort rar file. What lib is better to use to unrar rar files and unzip zip files in java 1.4

16. Having trouble opening a file in Java    stackoverflow.com

I am trying to open this file in java and i want to know what i am doing wrong. The in file lies in the same directory as my Java file, ...





17. file descriptor leak in java program : too many open files    stackoverflow.com

I have a program which suffer from file descriptor increasing. I see when I execute the command ls -l /proc/5969/fd where 5969 is the pid of the java program the number of ...

18. Java Too Many Open Files    stackoverflow.com

I am trying to write to multiple files, 19 to be exact. After writing to them a few hundred times I get the Java IOException: Too many open files. ...

19. open and close files - separate methods [java]    stackoverflow.com

Dear stackoverflow friends, I was hoping you could help me with the following: i am learning the basics of reading from txt files. I have code that works fine if everything is ...

20. Open and close applications from Java    stackoverflow.com

I want to make a program to open and close applications you have installed on your computer. I know that using

Runtime.getRuntime().exec("rundll32 SHELL32.DLL,ShellExec_RunDLL "+"M:\\myfile.doc"); 
open the Word document myfile.doc The problem is using ...

21. How to open a malformed file in Java    stackoverflow.com

I am coding a download manager program (like IDM) in Java. I want to open malformed files with a program that used to open all kinds of malformed files, when the user ...

22. how to open a file with name in a string in java    stackoverflow.com

 FileInputStream fis = new FileInputStream("./abc.txt");
I want to replace the quoted value by a string I also want to fill the string with different filenames in a switch statement so that I ...

23. SolrJ keeps indexed files open    stackoverflow.com

Possible Duplicate:
SolrJ addFile keeps documents open
Hey guys, I'm quite new to Apache Solr. My situation is the following: When my application starts up, it scans a ...

24. how to open file with default editor and wait until it is closed    stackoverflow.com

Possible Duplicate:
Catching system default editor closing event in java
It seems I can use java.awt.Desktop. It will work on Windows/Mac OS X/Linux. But I can't figure ...

25. java open file and sort data    stackoverflow.com

good day!who any one can help on how to sort data from my name.txt test.text cath zeny ana dana maria sheila heres my code:

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileNotFoundException;

import java.io.IOException;

public class ReadTextFileExample {

public static void main(String[] args) {

File file = ...

27. exec() question, not opening files    stackoverflow.com

So heres my problem, I'm trying to get my jar file to open up 5 files with time in between each file opening. When runPrograms[] is set to notepad.exe instead ...

28. how to open file with specific extension in fileDialogue    stackoverflow.com

I am trying to Open a file with specific extension ( .fcg or .wtg ) using file Dialog is there a way to do it ??

29. How do I opening a file in Java application environment?    stackoverflow.com

I have created a notepad, which is a jar file, using Java. Using this I created a text file and saved it with the extension .rtx. Now I want to right-click file.rtx in ...

30. How to open and read a .POS file?    stackoverflow.com

The .POS file contains some hand annotated Penn Treebank style stuff. Can I just open this using Java with any built-in streams and methods? I did open the file with WinHex, ...

31. Is there any way to open a ".dat" repository file from Visual Age for Java?    stackoverflow.com

I'm currently trying to recover some old code that was developed using IBM Visual Age for Java. Unfortunately I do not have an installation anymore, and the only thing I have ...

32. How to open all files that starts with specific prefix in java?    stackoverflow.com

Is there any way to open some of the text files in the directory that starts with a specific name in Java? For example in my directory I have the following files:

Ab-01.txt
Ab-02.txt
Ab-03.txt
Ab-04.txt
SomethingElse.txt
NotRelated.txt
So ...

33. Open and create .lzh file in java    stackoverflow.com

I want to open and create .lzh file in java. I find jlha library. But I can not find any examples of using this library. Is there a similar library ...

34. How to open and view a file(similar to that of double clicking a file) using Java    stackoverflow.com

I would like to know to know the code in Java that that will help perform the same operation as that of a double click in any OS on a file ...

35. Open in browser remote html file    stackoverflow.com

I am writing a java client-server application where some clients have the right to put html files to serve as login pages on the server and the server will ...

36. File size without opening the file    stackoverflow.com

Is there any way to determine a file's size without having to open it, as provided in the Java platform API (no 3rd party libs)? Also, I need the 64-bit size ...

37. opening file with java application automatically    stackoverflow.com

I want to create my own file format for a particular kind of file. When someone downloads this file I want their system to know it should be opened with my ...

38. Remotly Open File    coderanch.com

39. opening an outlook template    coderanch.com

40. open file    coderanch.com

41. Having Problems with Opening a file...    coderanch.com

I am having some problems with a program I am writing. It is for a class project. I am required to make an applet that allows a user to enter information about a person (first name, last name, date of birth, address, city, state, zip, phone). There is an array with 10-indexes for each piece of data. I have fullfilled the ...

42. Opening a file that already exists    coderanch.com

hey everyone. i'm trying to open a file for writing that already exists in the program's current directory. If I run my program once, it writes correctly to the file. If I then start the program again, it seems to recreate the file over the old file (thus losing the data that was written to it previously). i can't seem to ...

43. showing Open with dialogue    coderanch.com

Mohammad, Forgetting about Java for a second, how would you know what file format the data is in? A blob is just some binary data. You need to start by figuring out a way to know the file type or extension. You could store it in the database in another field. Or if it is always a certain type, you could ...

44. open file through registered handler    coderanch.com

what i require to do is to open a given file through the default/registered file extention handler. for instance if i have a .txt file i would want Notepad to open it (on windows). if on the otherhand the bytecode was executed on linux, gedit would open it (or whateverelse is the default app). is this possible and how? thanks.

45. how to make sure a file is complete when opening it    coderanch.com

Hi I have an application that continuously scans a directory for files. As soon as a file is found, some processing functions begin. The problem is that these files can be very large ones, and what if the file is transfered from the network? It may be incompletely downloaded, when the application will try to open it, and errors might occur. ...

46. File is open for long    coderanch.com

I have an application which opens a file does processing.The file is a big one so we do this in a loop.We read every 1000 lines once ina loop.the whole reading takes approx 20 sec but processing takes 2-3 hours as there are hughe processing logic for that stream.after the (reading+processing) we close the stream.Is this a problem.Will this be consuming ...

47. Opening a web page with Java    coderanch.com

I am not sure how toopein Internet Explorer to an internet site from an application. I have experience with opeining a connection to an internet site with I/O streams and getting the HTML from the site, but I cannot seem to find any information on how to just open up the page on the screen from an application. Can anyone help? ...

48. Open HTML file in desktop app    coderanch.com

Hello guys, I wanna open and display an HTML file in my app. I don't wanna open a browser, I wanna show it within my app. I have searched and found this way: String url = "http://www.google.com"; try{ JEditorPane editorPane = new JEditorPane(url); editorPane.setEditable(false); jFrame1.getContentPane().add(editorPane, BorderLayout.CENTER); jFrame1.setSize(200, 200); jFrame1.setVisible(true); //Put the editor pane in a scroll pane. JScrollPane editorScrollPane = new ...

49. Open a file for view    coderanch.com

50. How to open multiple files in external editor using java    coderanch.com

The easiest way is to pick an editor you know exists, and use the Runtime.exec() call to open the files. If you were using some sort of *nix OS, the following code would try and open all files in a directory with "gvim". public void openAllTheFiles() { String dirString = "/here/are/the/logs"; File dir = new File(dirString); File[] filesInDir = dir.listFiles(); for( ...

51. Is there a way to open .ser file?    coderanch.com

Or we could say that yes there is, and that way is by using an ObjectInputStream. From the question, it's not clear if you're familiar with the basics of how to use this. ObjectInputStream in = new ObjectInputStream(new FileInputStream("filename.ser")); int count = 0; try { while (true) { count++; try { Object obj = in.readObject(); System.out.println("obj #" + count + " ...

52. Other application opening a file    coderanch.com

Hi , Is there a way , with the help of which we can determine , whether any other application have opened the file or not. For Ex: If I give path to a txt file , and if have used notepad , to open that file , the function should return false , and as I close that file , ...

53. About Opening a file    coderanch.com

Does anyone there know how to open a text file and append its texts in a text area? I used the ff code to do that but the texts are in one straight line. This is my code: code: ---------------------------------------------------------------------------- public void actionPerformed(ActionEvent ae){ JMenuItem source = (JMenuItem)(ae.getSource()); if(source.getText().equalsIgnoreCase("open")){ try{ FileInputStream fi=new FileInputStream(openfile()); BufferedReader br=new BufferedReader(new InputStreamReader(fi)); String s01=br.readLine(); if(s01 != ...

54. How to open DICT.DZ file    coderanch.com

55. Open file using default editor    coderanch.com

Hell friends, sir , madam I have a problem. Consider a simple java program wherein I get the file path as input. Based on the extension of file I want to launch the associated editor. Example if I give a path of .jpg file then the file should get opened in the editor installed on the machine. I tried using Runtime ...

56. How to open a local file in Java program    coderanch.com

thanks for the response. Here is really I want to know. On a web page, I have a button, when a user clicks this button, it will open a PDF file, and Java program know where this PDF file is. I don't want to use Java script. The open action should happen in Java program. Thanks.

57. Open a file on the fly    coderanch.com

What do you mean by "open a file without saving it?". A file cannot be opened unless it exists on disk. Perhaps you are thinking of the way you can open a new document in, say, Microsoft Word, without saving it. That's something completely different. You could implement such a user interface in Java, but that has little to do with ...

58. Opening a file hpjtune tool    coderanch.com

HI, I collected gc through Xloggc:a.lgc to a file. when i try to opne the file a.lgc I got number format error. I removed all the numbers at the start of each line. Now I am getting no usefule data in this file. I am not sure what is wrong in this. I can't use -Xverbosegc . Is this versions problem. ...

59. Why I can't open my file?    coderanch.com

60. Open File Question?    coderanch.com

You should never open a file this way in a servlet. The reason being that it depends on the JVM's "current" directory. You have absolutely no control over the current directory from the servlet. Much better to provide a complete path in the servlet initialization parameters. That gives you real flexibility to put test.cfg anywhere. Bill

61. opening a file    coderanch.com

Krishna- If this is a silly answer is because I didn't understand your question. Can't you just create an hyperlink with an target="_blank"? that will open a new window, and since it is a file, a default program will open your pdf/word. If you have to generate your reports in different formats, then have a look at XML FO. HTH

62. open a file withot pops    coderanch.com

63. Open a VCalendar file on the fly    coderanch.com

Hello, I have stored a vCalendar (v2.0) file in the database and want to open the vCalendar file with Outlook using a link from my JSP page which calls a servlet. When clicking on the link on my local host (http://127.0.0.1:8080/myApp) it works fine and Outlook opens the file and prompts the user for an event reply. But when clicking on ...

64. opening a file in web-inf    coderanch.com

65. opening objectStreamed files    coderanch.com

ok... My goal is to open an objectStreamed files in my program by double-clicking on it in windows. I've tried to do this by setting the program to 'open with' to my jar containing my program, and to a batch file that runs the jar. My problem is getting windows to pass the double-clicked file to my program as an arguement. ...

66. Resolved: Opening A File In Its Default Program (Platform Independently)    coderanch.com

Hi, Firstly - apologies for the title of this post, I couldn't think of anything better! I've searched JavaRanch and Google for the answer to this question, but drawn blanks, I suspect that I'm searching for the wrong thing. In a nutshell, I'm writing some software in which a user can link to an/some external file(s). These could be anything, PDF's, ...

67. opening a file from java program    coderanch.com

hello all, I am trying to open a file from a java program and a weird problem happens: when I do this: Process process = Runtime.getRuntime().exec("cmd.exe /c c:\\sharedFolders\\aymane\\aymane.doc"); it works fine and when I do String path =C:\\shraredFolders\\" + "aymane" + "\\" + "aymane.doc" ; Process process = Runtime.getRuntime().exec("cmd.exe /c "+ path); it doesnt work. anybody knows why is this. I ...

68. exec() with arguments to open a file    coderanch.com

Hello, I have a third party CRM system which I would like to integrate with. I really want to launch into a particular record from my java app. The system includes notifications where the following text file is sent... [Problem] ID = 1234 ... with a file name of my.prospectproblem where .prospectproblem is associated with the program. I have two problems, ...

69. Could not able to open the file in the local system using http protocol    coderanch.com

hi Ranchers I want to open the file in my system using http protocol. I wrote the following lines of code. I have shared the PoeticLogs folder. Server: Tomcat 6.0 String urlString = "http://H_VAMSEE/PoeticLogs/ServerLog_2008-06-07.log"; try { URL url = new URL(urlString); url.openStream(); fileExists = true; } catch (MalformedURLException mue) { mue.printStackTrace(); // Do nothing. fileExist will be false and error will ...

70. open unknown file extensions with java    coderanch.com

Hello Please help me with the following: i am trying to open a file with a specific application using java. I am working on a desktop application. The following code using java.awt.Desktop works for known extension types,but when trying to open a file with an unknown extension it throws an exception. I know this is about to happen, because it's in ...

71. Opening an html file    coderanch.com

Here's some code I once used, hope it helps. The one thing I see is not setting the content type: editorPane = new JEditorPane(); editorPane.setEditable(false); editorPane.setContentType("text/html"); String s = ""; String sep = System.getProperty("file.separator"); s = "file:" + System.getProperty("user.dir") + sep + "com" + sep + "lockup" + sep + "login.html"; try { editorPane.setPage(s); } catch (IOException ioe) { ioe.printStackTrace(); } ...

72. File Opening limit    coderanch.com


Sun Certified Programmer for Java 2 Platform (SCJP)
Sun Certified Developer for Java 2 Platform (SCJD)
Sun Certified Web Component Developer for Java2 Platform, Enterprise Edition (SCWCD)
Sun Certified Business Component Developer for Java2 Platform, Enterprise Edition (SCBCD)
Sun Certified Enterprise Architect for J2EE (SCEA)
IBM Certified Enterprise Developer, WebSphere Studio V5.0

73. Open a file    coderanch.com

74. can not open the file    coderanch.com

Hi my program must open the file "me.txt" which contains numbers (number in each line) then it must insert its contents into an array of float type.but it has some errors i could not fix them i hope that you can help me here is my codeimport java.util.*; import java.io.*; class TextFileReader { private BufferedReader inputFile; private String fileName; private boolean ...

75. Open a HTML file    coderanch.com

You can use one of the java.lang.Runtime.exec() methods to launch the browser, if you know the path to the executable. Because Java is cross-platform, you can't just assume that it's IEXPLORE.EXE . You might ask the user to find the browser program in a file-selection box, then use Runtime.exec() to launch it.

76. opening file in explorer    coderanch.com

77. Options on Opening Files    coderanch.com

I was wondering what are the various options available for opening and reading from files in Java. I'm trying to open a file and parse through it grabbing each line which consists of : value 1 value 2 value 3..... I wanted to assign each value into a separate array or other such object. Each of these values will ...

78. open .java file    coderanch.com

79. Problem in opening a file in mac    coderanch.com

Hi All, I am using Runtime.getRuntime().exec("open "+"fileName");. And it is working fine when there is no space in file or folder name . But the application got crashed when I am trying to open a file with space in iots name. Please suggest me what I have to do in that case. Thanks Kushagra

80. How to open .do file?    coderanch.com

You can't open a .do file. If you want to see the application code, you need to look into your strut-config.xml file Look at my example : you see the .do is define there as the path of your web application. The browser will show that ...

81. How to open a file using Java    coderanch.com

Hi friends, I created a GUI which asks the user to select a file using JFileChooser. To be precise, the user should select a *.class file. After selecting the file, the user needs to click a button which will display all the methods in the selected class file. I have no clue or whatsoever to get the file which has been ...

82. how to open external files ?    coderanch.com

Hi, I'm doing this project as my school assignment. I've done as much as I can for all the source codes part without having tested because I'm having problems to open and access Mxx.mp3 files. I'm using NetBeans and I put all the files under "music" folder and put that folder into "src" folder under the NetBeans project directory. When I ...

83. Opening HTML file from a desktop application    coderanch.com

Hi, Can somebody help me. I have a fragment of code that is used to open HTML file from the C: drive in windows when a button is clicked. It did work perfect but one day it stopped working and I didn't do any changes inside the code, I really don't know why. Here is the code (everything is in the ...

84. open a file in browser    coderanch.com

86. Set my Java application as the default program to open a file extension    coderanch.com

Thanks Rob ... I have got something new here. The problem is in the path of the (*.amdli) file. When i wrote the complete path of the file in the console, it worked fine, so both of those worked fine : C:\Program files\madi lab>java -jar "madi lab.exe" 1.amdli C:\Program files\madi lab>java -jar "madi lab.exe" C:\Documents and Settings\1.amdli If the (*.amdli) file ...

87. too many open files - together with ProcessBuilder    coderanch.com

Hello, I'm going to process a bunch of files (few thousands) and I call external tools for that. The places where I open a file for reading or writing, I use close in the finally section. I also use close on the InputReader, I use for getting the output from the called tool. How can I find out, what breaks my ...

88. Opening a java file as popup window    coderanch.com

Hi, I have a java swing app with some data entry screens. In one of the screens I need to choose the date from date picker.I have separate java class for java date picker.But I need to open the date picker as Popup window and selecting the any of the date I need to close the popup and selected date should ...

89. Opening file from remote machine using authentication    coderanch.com

To open a file from a remote machine, you need 2 things: 1. Client software. This is software that must reside on the client machine that understands how to locate the remote machine (via network or other channels), to request the file, and to access the file data. 2. Server software. This is software that must reside on the remote machine ...

90. The application requester cannot establish the connection. (Too many open files)    coderanch.com

I develop application run in Websphere work manager. work manager is used to run thread in the webpshere applications erver. Every 5 minutes my thread try to get some data from MySQL database from the different host from the application server machine. When the Host of MySql database turned off, The work manager always try to connect to MySQL database and ...

91. opening file in java    coderanch.com

92. opening a file for relatively long time    coderanch.com

I need to open a file and process its data. It has large volume of data and the process takes long time while we process it and save it into backend. If my program has to open this file for at least 10 minutes while reading/processing it (it does not modify the file), will there be any I/O problem ?

93. Opening Excel sheet in a browser    coderanch.com

Hi I am generating an excel sheet in the java side using POI. This happens when the user clicks a button the screen. But the generated file opens with file File Download(with Open, Save, Cancel options). Instead i want my generated file to be opened in a new browser and embed the file inside it. How do i achieve this through ...

95. opening a file    coderanch.com

Hello I wonder is it possible to take files from a database and open it trough java programme? I need to put some files (.doc, .jpg, .txt) into a database, and then when i take it out, i need to put them in a list and when user selects a file from list, word or excel or paint will open it ...

96. I want to open an excel report and not its creation at some location    coderanch.com

Hi, in my table there are two columns which stores blob data one for csv and another for excel( the whole excel file is saved in the blob type). through java code i want to read that blob(excel) directly i mean there is nothing to write, you just need to read the stored excel file form the table column. So far, ...

97. Using multiple command line arguments to open multiple files    coderanch.com

Hey guys, I am trying to get the hang of CommandLine arguments and am trying to use two at a time say fro instance where I put two files in and I want my program to open both and collect statistics about it. This is what I have. How can I make it so two or more filenames can be added ...

98. How to open user system "select program to open with" for given file?    go4expert.com

Hi, I'm trying to make file management application in Java. I already know how to open file in system preferred application. It's quite easy. The other issue I thinking about now is that I need to implement "Open With" functionality (like in Ubuntu: you right press on the file -> select "Open With" -> "Other" and system's default application selection window ...

99. open file in java    go4expert.com

100. Using Java to open applications and files    java-forums.org

I recently wrote a program that allows me to search my files in a very specific way. They are all Guitar Pro files (.gp3, .gp4, .gp5) if it makes any difference for anybody. In the end, it prints out the list of files you search for. Is there a way to make the file open in the application associated with the ...