Hi everyone.
Im writing a program which will remove a line from a file on a ftp-server.
So far o have only written a program that can remove a line from a textfile and save it. But i cant make it work with the ftp.
And my other problem is that the line i want to remove is already within "". Eg.
<onx "hej.se"> and when i send that to a function its ("<onx "hej">") and the program will only read whats in the first 2 ".

my code:

PHP Code:
	try {

					URL url = new URL("ftp-server address");
					URLConnection urlc = url.openConnection();
					InputStream is = urlc.getInputStream(); // To download
					OutputStream os = urlc.getOutputStream(); // To upload
					}catch(java.io.IOException exp){ exp.printStackTrace();}
					String name;
					rev.removeLineFromFile("url", "<!DOCTYPE ONIXmessage SYSTEM "something" >");
and for the removepart its

PHP Code:
import java.io.File;
import org.w3c.dom.Document;
import org.w3c.dom.*;
import java.math.BigInteger;
import java.io.*;

import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.File;
import java.io.FileWriter;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter; 

import org.xml.sax.*;
import javax.xml.parsers.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.*;
import javax.xml.transform.stream.*;

public class remove2{

public void removeLineFromFile(String file, String lineToRemove) {

    try {

      File inFile = new File(file);
      if (!inFile.isFile()) {
        System.out.println("Parameter is not an existing file");
      //Construct the new file that will later be renamed to the original filename.
      File tempFile = new File(inFile.getAbsolutePath() + ".tmp");
      BufferedReader br = new BufferedReader(new FileReader(file));
      PrintWriter pw = new PrintWriter(new FileWriter(tempFile));
      String line = null;

      //Read from the original file and write to the new
      //unless content matches data to be removed.
      while ((line = br.readLine()) != null) {
        if (!line.trim().equals(lineToRemove)) {

      //Delete the original file
      if (!inFile.delete()) {
        System.out.println("Could not delete file");
      //Rename the new file to the filename the original file had.
     if (!tempFile.renameTo(inFile))
       System.out.println("Could not rename file");
    catch (FileNotFoundException ex) {
    catch (IOException ex) {

thanks in advance.