Savithri Devaraj

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

Recent posts by Savithri Devaraj

Originally posted by Joel Peach:
[B]Thanks Rick,
You are correct, there is no direct FTP protocol support class in java. All of the basic components you need are there: Threading, Socket I/O, File I/O, but you'd still need to write the control logic on your own. If you're feeling ambitious, the IETF RFC specification that defines FTP can be found at:
http://www.faqs.org/rfcs/rfc959.html
[end Quote]
I found it really amazing that we didn't have any FTP classes in java about 8 months ago, when I had to write some FTP software. Anything in the works at all for future releases?? All I had was a week or two, of which I spent a few days to find what support Java gives, finally I used the Sun.net.ftp.FtpClient class to get the job done. I know these are not supported anymore, but we have the jars, so we can maintain it ourselves.
It was not just me, there were a bunch of people on many forums asking for this same functionality. I think this is definitely a short coming of Java.
Savithri
[This message has been edited by Savithri Devaraj (edited December 12, 2001).]

We are mandated to use TCP/IP with des encryption algoritm and HL7 message type data on a project here. HL7 is Health Level 7. "Level Seven" refers to the highest level of the ISO communications model for Open Systems Interconnection (OSI) - the
application level. The application level addresses definition of the data to be exchanged, the timing of the interchange, and the communication of certain errors to the
application. The seventh level supports such functions as security checks, participant identification, availability checks, exchange mechanism negotiations and, most
importantly, data exchange structuring.
We will be implementing this using servlets in Java. We are particularly looking for what interface engines were used, what socket architecture was used, etc.
Any info appreciated,
Thanks
Savithri
[This message has been edited by Savithri Devaraj (edited December 12, 2001).]
Has anyone used the Oracle SQL Utility - XSU? What it does is, allow you to add data in a XML file to a database table and be able to extract data from a database table in the form of an XML file. Used both aspects of it without much trouble. As the notes on the utility suggest, I wanted to be able to use XSLT to transform the tags for the data in the XML file before adding it to the database. In other words, I wanted to use XSLT to maintain a mapping of the XML data to the table column names. The idea is to use the same table/column names, but be able to use different XML data to populate it, and vice versa.
For example given the following XML file
<XML version="1.0">
<ROWSET>
<ROW>
<EMPNAME>DAVID</EMPNAME>
<EMPNO>2345</EMPNO>
</ROW>
<ROW>
<EMPNAME>DOE</EMPNAME>
<EMPNO>345</EMPNO>
</ROW>
</ROWSET>
</XML>
I wanted the XML to look like this:
<XML version="1.0">
<ROWSET>
<ROW>
<EMPLOYEE_LNAME>DAVID</EMPLOYEE_LNAME>
<EMPLOYEE_ID>2345</EMPLOYEE_ID>
</ROW>
<ROW>
<EMPLOYEE_LNAME>DOE</EMPLOYEE_LNAME>
<EMPLOYEE_ID>345</EMPLOYEE_ID>
</ROW>
</ROWSET>
</XML>
The XSL for this transformation should be pretty simple. Can anyone give a hand here?
Thanks in advance,
Savithri

Originally posted by sankarsv:
In http, call to connect() method id not required....I donno in ftp. But u can still try the same....


Sorry, the exception is on the getOutputStream() method , not on the connect(). I tried without the connect(), the same exception is still thrown
Savithri
23 years ago
FTP

Originally posted by Carl Trusiak:
[B]Yes there is. You have to understand a little about the URL it is expecting.
ftp://username [email protected]/full/path/to/file/filename;type=x
type for getInputStream can be 'd' for directory listing, 'a' for Ascii down load and 'i' for Binary download.
type for getOuputStream can be 'a' for ascii upload and 'i' for binary upload.
So, to put a text file you can use code similar to the following

[/B]


Carl,
Where can I find more information to read up on this?
Savithri
FTP

[/b]
</BLOCKQUOTE>
Carl,
I appreciate your help here, but what is "/full/path/to/file/filename"?? Did you mean "filedirectory/filename" ??
I am pretty much doing the same thing, but I get an exception on the getOutputStream() statement. UnknownServiceException" - This service is not supported by the protocol.
Only difference is - I am not setting type='a'. I am going to try that next.
Any ideas??
Savithri

[This message has been edited by Savithri Devaraj (edited June 26, 2001).]
I have this class which is using FTP as a protocol to send files on a URL connection. I get the exception :UnknownServiceException on the line siteCon.connect(). Any help appreciated.
Here is the code:
private class FtpFile {
public FtpFile( String url, String fname) throws Exception
{
URL site = new URL(url);
URLConnection siteCon = site.openConnection();
siteCon.setDoInput(true);
siteCon.setDoOutput(true);
siteCon.connect();
System.out.println("Allowed interaction is " + siteCon.getAllowUserInteraction() + siteCon.getDoOutput() );
OutputStream out = siteCon.getOutputStream();
// Send the file out
File file_in= new File(fname);
FileInputStream is= new FileInputStream(file_in);
int c;
byte[] bytes = new byte[1024];
int total_bytes=0;
while((c=is.read(bytes)) !=-1)
{
total_bytes +=c;
out.write(bytes,0,c);
}
out.flush();
out.close();
//Verify that the file is there
int read_bytes = 0;
site = new URL(url+"//"+fname);
siteCon = site.openConnection();
siteCon.setDoInput(true);
siteCon.connect();
InputStream in = siteCon.getInputStream();

while((c=in.read(bytes)) != -1)
{
read_bytes += c;
}
System.out.println("File read from destination, total bytes = " + read_bytes);


}
}

Savithri
23 years ago

Originally posted by Jeff Holmes:
Thanks, I appreciate the effort to figure this out, and you won't be forgoten. Thanks again, Jeff
[This message has been edited by Jeff Holmes (edited November 01, 2000).]


This is similar to what I am doing I am able to use the classes in Silverstream application server environment, but don't see any documentation.
Where is the documentation for the sun.net.ftp classes?
Carl, How are you interpreting the error messages??
Thanks in advance,
Savithri
Does anyone know where documentatoin exists for sun.net classes?
Thanks in advance,
Savithri
Is it possible to use FileWriter class to send a file to an ftp site?
What I mean is, I want to be able to send files at a time instead of using a write(char[],..) or writing strings at a time. I need to ftp a few large files to a given site. Also, for ftping I intend to use URL and URL connection. Is there another way to do it?
Thanks in advance,
Savithri
23 years ago
FTP
Could some post some examples for ftping files over to an IP address?
Iam thinking of using the URL class with protocol=ftp. Is this the way to do it?
Thanks,
Savithri
Got it!
I can use URL class with protocol=ftp.
Savithri
23 years ago
What support classes do I have with jdk 1.3 to ftp over to a site and put certain files there in a java program?
Any help appreciated,
Savithri
23 years ago
Hi,
What APIs does Java have to use XML in java applications?
We have a Java project which needs some redesign for 2 sets of forms. A lot of processing in the sets are similar with different database entities manipulated. Is this a good opportunity to use XML? We are using Java 1.2 with SilverStream Application Server and Oracle for our database.
Specifically, what is the interface between java and XML?
Thanks for your help,
Savithri
sun.awt.motif.MToolkit is being returned as the default toolkit for my windows application. This class doesn't exist in my java home/din/classes.zip. As a result, I am getting java.awt.AWTError. What is the default toolkit for a WindowsNT application?
Please help,
Savithri
24 years ago