llaves

Carnape
28 de Junio del 2004
tengo un metodo q kiero quitar la excepcion q lanza y bueno no se pq me da error en las llaves, haber si es q toy un poco ciego y alguien me puede ayudar en algo,, gracias,, ahi va,,,

public void sourceStartUp() //throws IbafException
{
try
{
// connect to the remote server and log in using the reqeusted FTP
// library. Defaults to the org.openadaptor.adaptor.ftp.SunFTP class
log.debug(_name + " FTP class library: " + _library);
Class c = Class.forName(_library);
_ftp = (FTP) c.newInstance();

// check that the port has been supplied and if not then use the default
// for the library classes
if (_port == -1)
_port = _ftp.getDefaultPort();

// connect to the remote server
_ftp.connect(_host, _port);

_ftp.logon(_user, _password);

// init the ftp connection
_ftp.initSession(_sourceDir, true);

// if we have a wildcard in the file name then we assume that we are
// performing a mget operation
if (_sourceFile.indexOf("*") > -1)
{
_fileNames = _ftp.fileList(_sourceFile);
if (_fileNames == null)
throw new IbafException("No files match the pattern [" + _sourceFile + "]");
}
else
{
// otherwise we simply add the single file name to the array
_fileNames = new String[1];
_fileNames[0] = _sourceFile;
}

// display list of the file(s) to be retrieved
log.debug(_name + " Retrieving:");
for (int i = 0; i < _fileNames.length; i++)
log.debug("tRetrieving " + _fileNames[i]);

}
} /* aki tengo error esta llave cierra el metodo */

imaz
28 de Junio del 2004
debes de quitar la ultima llave y el try con su llave.

agur.

Carnape
28 de Junio del 2004
gracias por contestar, te cuento q eso ya lo hice y sigue dando error, por cierto una cosa q se me olvido kitar es q en la linea donde pone " if (_fileNames == null)" se me olvido comentarlo con // pero vamos q si q lo hice en mi programa y me da el mismo error lo q pasa es q aki se me olvido "Actualizar eso" entiendes?\' no se q puede ser,,, lo tengo asi:
(por cierto en las lineas donde pone: ftp me da error.

public void sourceStartUp() //throws IbafException
{

// connect to the remote server and log in using the reqeusted FTP
// library. Defaults to the org.openadaptor.adaptor.ftp.SunFTP class
log.debug(_name + " FTP class library: " + _library);
Class c = Class.forName(_library);
_ftp = (FTP) c.newInstance();

// check that the port has been supplied and if not then use the default
// for the library classes
if (_port == -1)
_port = _ftp.getDefaultPort();

// connect to the remote server
_ftp.connect(_host, _port);

_ftp.logon(_user, _password);

// init the ftp connection
_ftp.initSession(_sourceDir, true);

// if we have a wildcard in the file name then we assume that we are
// performing a mget operation
if (_sourceFile.indexOf("*") > -1)
{
_fileNames = _ftp.fileList(_sourceFile);
if (_fileNames == null)
;
//throw new IbafException("No files match the pattern [" + _sourceFile + "]");
}
else
{
// otherwise we simply add the single file name to the array
_fileNames = new String[1];
_fileNames[0] = _sourceFile;
}

// display list of the file(s) to be retrieved
log.debug(_name + " Retrieving:");
for (int i = 0; i < _fileNames.length; i++)
log.debug("tRetrieving " + _fileNames[i]);
}
/* catch (Exception e)
{
throw new IbafException("Failed to initialise FTPSource: " + e.getMessage());
} */


gRAcias de nuevo amig@