src/java/fr/jayasoft/ivy/repository/ssh/SshRepository.java
/**
     * Not really streaming...need to implement a proper streaming approach?
     * @param resource to stream
     * @return InputStream of the resource data
     */
Not really streaming...need to implement a proper streaming approach.
@param resource to stream
@return InputStream of the resource data
Not really streaming ... need to implement a proper streaming approach . @param resource to stream @return InputStream of the resource data
public InputStream openStream(SshResource resource) throws IOException {
        Session session = getSession(resource.getName());
        Scp scp = new Scp(session);
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        try {
            scp.get(resource.getName(),os);
        } catch (IOException e) {
            if(session != null)
                releaseSession(session,resource.getName());
            throw e;
        } catch (RemoteScpException e) {
            throw new IOException(e.getMessage());
        }
        return new ByteArrayInputStream(os.toByteArray());
    }
public InputStream openStream ( SshResource resource ) throws IOException { Session session = getSession ( resource . getName ( ) ) ; Scp scp = new Scp ( session ) ; ByteArrayOutputStream os = new ByteArrayOutputStream ( ) ; try { scp . get ( resource . getName ( ) , os ) ; } catch ( IOException e ) { if ( session != null ) releaseSession ( session , resource . getName ( ) ) ; throw e ; } catch ( RemoteScpException e ) { throw new IOException ( e . getMessage ( ) ) ; } return new ByteArrayInputStream ( os . toByteArray ( ) ) ; }
Not really streaming...need to implement a proper streaming approach?
Not really streaming ... need to implement a proper streaming approach?