@Override public OutputStream getOutputStream () throws IOException { return new SmbFileOutputStream(this); }
/** * Creates an output stream to write the file content to. */ @Override protected OutputStream doGetOutputStream(boolean bAppend) throws Exception { return new SmbFileOutputStream(file, bAppend); }
/** * This URLConnection method just returns a new <tt>SmbFileOutputStream</tt> created with this file. * * @throws IOException thrown by <tt>SmbFileOutputStream</tt> constructor */ public OutputStream getOutputStream() throws IOException { return new SmbFileOutputStream( this ); }
/** * Creates an output stream to write the file content to. */ @Override protected OutputStream doGetOutputStream(final boolean bAppend) throws Exception { return new SmbFileOutputStream(file, bAppend); }
/** * This URLConnection method just returns a new <tt>SmbFileOutputStream</tt> created with this file. * * @throws IOException thrown by <tt>SmbFileOutputStream</tt> constructor */ public OutputStream getOutputStream() throws IOException { return new SmbFileOutputStream( this ); }
/** * This URLConnection method just returns a new <tt>SmbFileOutputStream</tt> created with this file. * * @throws IOException thrown by <tt>SmbFileOutputStream</tt> constructor */ public OutputStream getOutputStream() throws IOException { return new SmbFileOutputStream( this ); }
/** * This URLConnection method just returns a new <tt>SmbFileOutputStream</tt> created with this file. * * @throws IOException thrown by <tt>SmbFileOutputStream</tt> constructor */ public OutputStream getOutputStream() throws IOException { return new SmbFileOutputStream( this ); }
@Override public OutputStream getAppendOutputStream() throws IOException { return new SmbFileOutputStream(file, true); }
@Override public SmbFileOutputStream openOutputStream ( boolean append, int openFlags, int access, int sharing ) throws SmbException { return new SmbFileOutputStream(this, append, openFlags, access, sharing); }
@Override public OutputStream getOutputStream () throws IOException { return new SmbFileOutputStream(this); }
@Override public OutputStream getOutputStream() throws IOException { return new SmbFileOutputStream(file, false); }
@Override public SmbFileOutputStream openOutputStream () throws SmbException { return new SmbFileOutputStream(this); }
@Override public SmbFileOutputStream openOutputStream ( boolean append, int openFlags, int access, int sharing ) throws SmbException { return new SmbFileOutputStream(this, append, openFlags, access, sharing); }
@Override public SmbFileOutputStream openOutputStream () throws SmbException { return new SmbFileOutputStream(this); }
String smbUrl = "smb://username:password@server/share/file"; SmbFileOutputStream fos = new SmbFileOutputStream(new SmbFile(smbURL));
String smbUrl = "smb://username:password@server/share/file"; SmbFileOutputStream fos = new SmbFileOutputStream(new SmbFile(smbURL));
/** * Return the <code>OutputStream</code> used to write * information to this pipe instance. The act of writing data * to this stream will result in response data recieved in the * <code>InputStream</code> associated with this Named Pipe * instance (unless of course it does not elicite a response or the pipe is write-only). */ public OutputStream getNamedPipeOutputStream() throws IOException { if( pipeOut == null ) { if(( pipeType & PIPE_TYPE_CALL ) == PIPE_TYPE_CALL || ( pipeType & PIPE_TYPE_TRANSACT ) == PIPE_TYPE_TRANSACT ) { pipeOut = new TransactNamedPipeOutputStream( this ); } else { pipeOut = new SmbFileOutputStream(this, false, (pipeType & 0xFFFF00FF) | SmbFile.O_EXCL ); } } return pipeOut; } }
/** * Return the <code>OutputStream</code> used to write * information to this pipe instance. The act of writing data * to this stream will result in response data recieved in the * <code>InputStream</code> associated with this Named Pipe * instance (unless of course it does not elicite a response or the pipe is write-only). */ public OutputStream getNamedPipeOutputStream() throws IOException { if( pipeOut == null ) { if(( pipeType & PIPE_TYPE_CALL ) == PIPE_TYPE_CALL || ( pipeType & PIPE_TYPE_TRANSACT ) == PIPE_TYPE_TRANSACT ) { pipeOut = new TransactNamedPipeOutputStream( this ); } else { pipeOut = new SmbFileOutputStream(this, false, (pipeType & 0xFFFF00FF) | SmbFile.O_EXCL ); } } return pipeOut; } }
try { String filePath = "myserver/dir"; String fileName = "myFile.txt"; String user = "username"; String password = "password"; // URL: smb://user:passwd@host/share/filname SmbFileOutputStream out = new SmbFileOutputStream("smb://" + user + ":" + password + "@" + filePath + File.separator + fileName); out.write("test".getBytes()); out.close(); } catch (Exception e) { e.printStackTrace(); }
@Override public void append(InputStream inputStream, String destination) throws IOException { SmbFile smbFile = createSmbFileObject(destination); OutputStream fileOutputStream = new SmbFileOutputStream(smbFile, true); FileCopyUtils.copy(inputStream, fileOutputStream); }