Sandeep Lakshmipathy

Ranch Hand
+ Follow
since Mar 05, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Sandeep Lakshmipathy

Great job Richard, considering that u were working full time. Give us some more info abt the type of questions u found and some more technical comments abt questions u got.
All the best.
Dear Friends,
I want some help on using the StreamTokenizer. I have to read comma separated data from a file and retrieve the each value for processing. I thought of using the treamTokenizer where I can directly give a Reader as input and start getting the tokens. But I notice that I have no option to specify comma as a delimiter, something that can be done in the String tokenizer, and the nextToken() returns int values.
How do I handle these int values to be interpreted as some numbers directly? Also, using a StringTokenizer will not be efficient since I will have to form a new StringTokenizer object for each line that is read (Or is there a way out for this issue? Please let me know).
Thanks
22 years ago
dear friends
I want to check if the user has entered a wsdl implementation file uri or an interface file uri. I am currently doing it using the checking for service tag. Is there any other way or method to do the same?
Thanks
Sandeep
22 years ago
A more generic approach would be some thing like this
//.........
Process p = Runtime.getRuntime().exec(cmd);
if(p.waitFor() != 0)
System.out.println(getOutAndErrStream(p));
//
private String getOutAndErrStream(Process p){

StringBuffer cmd_out = new StringBuffer("");
if(p != null){
BufferedReader is = new BufferedReader(new InputStreamReader(p.getInputStream()));
String buf = "";
try{
while((buf = is.readLine()) != null){
cmd_out.append(buf);
cmd_out.append (System.getProperty"line.separator"));
}
is.close();
is = new BufferedReader(new InputStreamReader(p.getErrorStream()));
while((buf = is.readLine()) != null){
cmd_out.append(buf);
cmd_out.append("\n");
}
is.close();
}catch(Exception e){
e.printStackTrace();
}
}
return cmd_out.toString();
}
22 years ago
Dear Friends,
I see that in Linux when I make the statement
getRuntime.exec("javac -classpath \"/root/test\" A.java"), the statement will result in compilation error of the javac cmd i am trying to execute when I run my test program. It works when I remove quotes i the -classpath option. But that could be a problem if the classpath has a dir that has spaces in its name
What is the problem. As i am presuming, is it a problem with exec() call in Linux
Thanks
22 years ago
Thanks a lot
I think the same will help me too
22 years ago
Dear Friends,
I want to know how the JTable columns can be dynamically hidden and reshown as per user request. Please help in this regard
Thanks
Sandeep
22 years ago
In my java program, I dynamically compile programatically generated .java files using the process.exec() call. Here I used the javac command with -classpath option to specify the classpath to be used for compilation. But I saw that the classpath had directories with spaces in their name and so enclosed the argument to classpath in "". This seems to create problems in Linux. Is there a general workaround for this?
Thanks
Sandeep
22 years ago
I feel the job can be achieved using a manual search approach. But that could be messy since there are lot of issues to handle and some how feel that the vast amount of API calls available would definitely handled the issue.
In a manual approach, we can do a backtrace in case we find base types and so on. But could be hard
Dear Friends,
I would like to know of any API call that
will give me a list of all attributes expected for a
given element by looking into the schema that the xml
file uses
Thank you
Dear Friends,
If the user should be able to build an xml file conforming to a xsd, then is it possible for me to write a program that will guide the user to build an xml file starting from the root element and going so on following the xsd. This program should only read the xsd, know the required elements and help the user build them. Please help me in this regard
Thanks
Thanks
That was of help to me. It did the job.
Bye
22 years ago
Dear friends,
The System.setProperty() allows the setting of the classpath at runtime on my local machine from an application. But I see that the classes are not loaded from them and ClassNotFounfException occurs. Is it that the classpath path at app load time is only considered ? Then why should they allow for setting the classpath property. I would loke to know if the above task could be done without using a custom classloader ?
Thanks
22 years ago
I do not want to use the process class. and i want to compile using the method calls. also, if the user has jre installed on his machine, my code using Process class and javac will not work.
22 years ago
I have written a program that asks the user for a java file name and will compile it on the fly using a call to compile() method in the package com.sun.tools.javac and class Main. If i am using the IBM jdk, or any other jdk, will this package be a part of it? The bigger question is, Is there a standard way of compiling classes on the fly?
Can we use the Compiler class for this purpose?
Thanks
22 years ago