Examples of RemoteFileSystemException


Examples of org.jboss.soa.esb.util.RemoteFileSystemException

                try
                {
                    changeRemoteDirectory() ;
                    if (!m_oConn.deleteFile(p_oFile.getName()))
                    {
                        throw new RemoteFileSystemException("Failed to delete remote file: " + m_oConn.getReplyString());
                    }
                }
                catch (final IOException ioe)
                {
                    throw new RemoteFileSystemException(ioe);
                }
        }
View Full Code Here

Examples of org.jboss.soa.esb.util.RemoteFileSystemException

                {
                        changeRemoteDirectory();
                        if (!m_oConn.rename(FtpClientUtil.fileToFtpString(p_oFrom),
                                FtpUtils.fileToFtpString(p_oTo)))
                        {
                            throw new RemoteFileSystemException("Failed to rename file: " + m_oConn.getReplyString());
                        }
                }
                catch (final IOException ioe)
                {
                    throw new RemoteFileSystemException(ioe);
                }
        }
View Full Code Here

Examples of org.jboss.soa.esb.util.RemoteFileSystemException

            try
            {
                changeRemoteDirectory() ;
                if (!m_oConn.rename(p_sFrom, p_sTo))
                {
                    throw new RemoteFileSystemException("Failed to rename file: " + m_oConn.getReplyString());
                }
            }
            catch (final IOException ioe)
            {
                throw new RemoteFileSystemException(ioe);
            }
        }
View Full Code Here

Examples of org.jboss.soa.esb.util.RemoteFileSystemException

                final String sRemoteTmp = p_sRemoteName + TMP_SUFFIX;
               
                final OutputStream os = m_oConn.storeFileStream(sRemoteTmp) ;
                if (os == null)
                {
                    throw new RemoteFileSystemException("Failed to obtain output stream: " + m_oConn.getReplyString()) ;
                }
               
                try
                {
                    final FileInputStream fis = new FileInputStream(p_oFile) ;
                    try
                    {
                        copyStream(fis, os) ;
                    }
                    finally
                    {
                        fis.close() ;
                    }
                }
                finally
                {
                    os.flush() ;
                    os.close() ;
                }
                if (!m_oConn.completePendingCommand())
                {
                    throw new RemoteFileSystemException("Failed to upload contents: " + m_oConn.getReplyString()) ;
                }
               
                boolean retryProblem = true// https://jira.jboss.org/jira/browse/JBESB-1995

                for (int i = 0; i < m_iRenameRetry; i++)
                {
                    if (m_oConn.rename(sRemoteTmp, p_sRemoteName))
                    {
                        retryProblem = false;
                       
                        break;
                    }
                    else
                    {
                        if (i+1 < m_iRenameRetry)
                        {
                            try
                            {
                                Thread.sleep(1000L); // 1 second
                            }
                            catch (final Exception ex)
                            {
                            }
                        }
                    }
                }
               
                if (retryProblem)
                    throw new RemoteFileSystemException("Failed to rename file: " + m_oConn.getReplyString());
            }
            catch (final IOException ioe)
            {
                throw new RemoteFileSystemException(ioe);
            }
        }
View Full Code Here

Examples of org.jboss.soa.esb.util.RemoteFileSystemException

            final String remoteDir = getRemoteDir() ;
            if ((remoteDir != null) && (remoteDir.length() > 0))
            {
                if (!m_oConn.changeWorkingDirectory(remoteDir))
                {
                    throw new RemoteFileSystemException("Failed to change to remote directory: " + m_oConn.getReplyString());
                }
            }
        }
View Full Code Here

Examples of org.jboss.soa.esb.util.RemoteFileSystemException

        m_oParms.setAttribute(PARMS_CERTIFICATE_NAME, m_oCertificateName);
      }
    }
    catch (Exception e)
    {
      throw new RemoteFileSystemException(e);
    }
  }
View Full Code Here

Examples of org.jboss.soa.esb.util.RemoteFileSystemException

                {
                    ftpsClient = new FTPSClient() ;
                }
                catch (final NoSuchAlgorithmException nsae)
                {
                    throw new RemoteFileSystemException(nsae) ;
                }
               
                try
                {
                    ftpsClient.setTrustManager(new ESBTrustManager(m_oCertificate)) ;
                }
                catch (final Exception ex)
                {
                    throw new RemoteFileSystemException("Exception creating trust manager", ex) ;
                }
                return ftpsClient ;
        }
View Full Code Here

Examples of org.jboss.soa.esb.util.RemoteFileSystemException

                final URI uri ;
                try {
                        uri = m_oEpr.getURI();
                } catch (URISyntaxException e) {
                        throw new RemoteFileSystemException(e);
                }

                m_sFtpServer = uri.getHost();

                String[] sa = null;

                if (uri.getUserInfo() != null)
                        sa = uri.getUserInfo().split(":");

                final int saLen = (sa == null ? 0 : sa.length) ;
                switch(saLen)
                {
                case 2:
                    m_sPasswd = sa[1] ;
                case 1:
                    m_sUser = sa[0] ;
                }

                m_sRemoteDir = uri.getPath();

                if ((m_sRemoteDir == null) || (m_sRemoteDir.equals("")))
                        m_sRemoteDir = FtpUtils.getRemoteDir();

                m_iPort = uri.getPort();

                m_sLocalDir = FtpUtils.getLocalDir();

                try
                {
                        m_oCertificate = p_oP.getCertificateURI() ;
                }
                catch (final URISyntaxException urise)
                {
                    throw new RemoteFileSystemException(urise);
                }
                m_sPassphrase = p_oP.getPassphrase() ;

                configTreeFromEpr();
View Full Code Here

Examples of org.jboss.soa.esb.util.RemoteFileSystemException

                                channel.connect();
       
                                m_oSftpChannel = (ChannelSftp) channel;
       
                                if (!session.isConnected())
                                        throw new RemoteFileSystemException("Can't connect to FTP server");
                        }
                        catch (JSchException ex)
                        {
                                if ((session != null) && session.isConnected())
                                {
                                    session.disconnect() ;
                                }
                                _logger.error("Caught Secure FTP Exception.");
                                _logger.debug("Caught Secure FTP Exception.", ex);
                               
                                throw new RemoteFileSystemException(ex);
                        }
                }
        }
View Full Code Here

Examples of org.jboss.soa.esb.util.RemoteFileSystemException

                        m_oSftpChannel.cd(getRemoteDir()) ;
                        m_oSftpChannel.rm(p_sFile);
                }
                catch (SftpException ex)
                {
                        throw new RemoteFileSystemException(ex);
                }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.