<project name="jcifs" default="usage" basedir=".">
- <property name="version" value="1.1.8"/>
- <property name="reldate" value="Feb 10, 2005"/>
+ <property name="version" value="1.1.9"/>
+ <property name="reldate" value="Feb 27, 2005"/>
<target name="usage">
<echo>
* Determines the address of a host given it's host name. The name can be a
* machine name like "jcifs.samba.org", or an IP address like "192.168.1.15".
*
- * @param host NetBIOS or DNS hostname to resolve
+ * @param hostname NetBIOS or DNS hostname to resolve
* @throws java.net.UnknownHostException if there is an error resolving the name
*/
(( src[srcIndex++] & 0xFF ) << 8 ) +
( src[srcIndex++] & 0xFF );
}
+ static int readn( InputStream in,
+ byte[] b,
+ int off,
+ int len ) throws IOException {
+ int i = 0, n;
+
+ while (i < len) {
+ n = in.read( b, off + i, len - i );
+ if (n <= 0) {
+ break;
+ }
+ i += n;
+ }
+
+ return i;
+ }
static int readPacketType( InputStream in,
byte[] buffer,
int bufferIndex )
throws IOException {
int n;
- if(( n = in.read( buffer, bufferIndex, HEADER_LENGTH )) != HEADER_LENGTH ) {
+ if(( n = readn( in, buffer, bufferIndex, HEADER_LENGTH )) != HEADER_LENGTH ) {
if( n == -1 ) {
return -1;
}
*
* @param flags The flags to apply to this message.
* @param lmResponse The LanManager/LMv2 response.
- * @param domain The NT/NTLMv2 response.
+ * @param ntResponse The NT/NTLMv2 response.
* @param domain The domain in which the user has an account.
* @param user The username for the authenticating user.
* @param workstation The workstation from which authentication is
/**
* Sets the NT/NTLMv2 response for this message.
*
- * @param lmResponse The NT/NTLMv2 response.
+ * @param ntResponse The NT/NTLMv2 response.
*/
public void setNTResponse(byte[] ntResponse) {
this.ntResponse = ntResponse;
* servers.
*
* @param dest the destination file or directory
- * @throw SmbException
+ * @throws SmbException
*/
public void copyTo( SmbFile dest ) throws SmbException {
SmbComReadAndX req;
*
* @return The length of the file in bytes or 0 if this
* <code>SmbFile</code> is not a file.
- * @throw SmbException
+ * @throws SmbException
*/
public long length() throws SmbException {
* the <tt>setAttributes()</tt> method.
*
* @return the <tt>ATTR_*</tt> attributes associated with this file
- * @throw SmbException
+ * @throws SmbException
*/
public int getAttributes() throws SmbException {
if( getUncPath0().length() == 1 ) {
* bitset by bitwise ORing the <tt>ATTR_*</tt> constants. Setting the
* value returned by <tt>getAttributes</tt> will result in both files
* having the same attributes.
- * @throw SmbException
+ * @throws SmbException
*/
public void setAttributes( int attrs ) throws SmbException {
if( getUncPath0().length() == 1 ) {
* Make this file read-only. This is shorthand for <tt>setAttributes(
* getAttributes() | ATTR_READ_ONLY )</tt>.
*
- * @throw SmbException
+ * @throws SmbException
*/
public void setReadOnly() throws SmbException {
setAttributes( getAttributes() | ATTR_READONLY );
* Turn off the read-only attribute of this file. This is shorthand for
* <tt>setAttributes( getAttributes() & ~ATTR_READONLY )</tt>.
*
- * @throw SmbException
+ * @throws SmbException
*/
public void setReadWrite() throws SmbException {
setAttributes( getAttributes() & ~ATTR_READONLY );
* access an SMB resource. Currently only retrieving data and information
* is supported (i.e. no <tt>doOutput</tt>).
*
- * @depricated Use getURL() instead
+ * @deprecated Use getURL() instead
* @return A new <code>{@link java.net.URL}</code> for this <code>SmbFile</code>
- * @throw MalformedURLException
+ * @throws MalformedURLException
*/
public URL toURL() throws MalformedURLException {
return url;
* to make such a determination.
*
* @return A hashcode for this abstract file
- * @throw SmbException
+ * @throws SmbException
*/
public int hashCode() {
* @param obj Another <code>SmbFile</code> object to compare for equality
* @return <code>true</code> if the two objects refer to the same SMB resource
* and <code>false</code> otherwise
- * @throw SmbException
+ * @throws SmbException
*/
public boolean equals( Object obj ) {
* as <code>getPath</code>.
*
* @return The original URL representation of this SMB resource
- * @throw SmbException
+ * @throws SmbException
*/
public String toString() {
/**
* This URLConnection method just returns a new <tt>SmbFileInputStream</tt> created with this file.
*
- * @throw IOException thrown by <tt>SmbFileInputStream</tt> constructor
+ * @throws IOException thrown by <tt>SmbFileInputStream</tt> constructor
*/
public InputStream getInputStream() throws IOException {
return new SmbFileInputStream( this );
/**
* This URLConnection method just returns a new <tt>SmbFileOutputStream</tt> created with this file.
*
- * @throw IOException thrown by <tt>SmbFileOutputStream</tt> constructor
+ * @throws IOException thrown by <tt>SmbFileOutputStream</tt> constructor
*/
public OutputStream getOutputStream() throws IOException {
return new SmbFileOutputStream( this );
* URL syntax.
*
* @param url An smb URL string representing the file to read from
- * @return A new <code>InputStream</code> for the specified <code>SmbFile</code>
*/
public SmbFileInputStream( String url ) throws SmbException, MalformedURLException, UnknownHostException {
* {@link jcifs.smb.SmbFile} for a detailed description and examples of
* the smb URL syntax.
*
- * @param url An smb URL string representing the file to write to
- * @return A new <code>InputStream</code> for the specified <code>SmbFile</code>
+ * @param file An <code>SmbFile</code> specifying the file to read from
*/
public SmbFileInputStream( SmbFile file ) throws SmbException, MalformedURLException, UnknownHostException {
* the smb URL syntax.
*
* @param url An smb URL string representing the file to write to
- * @return A new <code>OutputStream</code> for the specified file
*/
public SmbFileOutputStream( String url ) throws SmbException, MalformedURLException, UnknownHostException {
* {@link jcifs.smb.SmbFile} for a detailed description and examples of
* the smb URL syntax.
*
- * @param url An <code>SmbFile</code> specifying the file to write to
- * @return A new <code>OutputStream</code> for the specified <code>SmbFile</code>
+ * @param file An <code>SmbFile</code> specifying the file to write to
*/
public SmbFileOutputStream( SmbFile file ) throws SmbException, MalformedURLException, UnknownHostException {
* end of the file rather than the beginning.
*
* @param url An smb URL string representing the file to write to
- * @return A new <code>OutputStream</code> for the specified <code>url</code>
+ * @param append Append to the end of file
*/
public SmbFileOutputStream( String url, boolean append ) throws SmbException, MalformedURLException, UnknownHostException {
* the smb URL syntax. If the second argument is <code>true</code>, then
* bytes will be written to the end of the file rather than the beginning.
*
- * @param url An <code>SmbFile</code> representing the file to write to
- * @return A new <code>OutputStream</code> for the specified <code>SmbFile</code>
+ * @param file An <code>SmbFile</code> representing the file to write to
+ * @param append Append to the end of file
*/
public SmbFileOutputStream( SmbFile file, boolean append ) throws SmbException, MalformedURLException, UnknownHostException {
combined with the bitwise OR '|' to specify that other peocesses may read,
write, and/or delete the file while the jCIFS user has the file open.
*
- * @param url An <code>SmbFile</code> representing the file to write to
- * @return A new <code>OutputStream</code> for the specified <code>SmbFile</code>
+ * @param url An smb URL representing the file to write to
+ * @param shareAccess File sharing flag: <code>SmbFile.FILE_NOSHARE</code> or any combination of <code>SmbFile.FILE_READ</code>, <code>SmbFile.FILE_WRITE</code>, and <code>SmbFile.FILE_DELETE</code>
*/
public SmbFileOutputStream( String url, int shareAccess ) throws SmbException, MalformedURLException, UnknownHostException {
}
/**
- * This is the same as {@link jcifs.util.Log#toHexString(int val, int
+ * This is the same as {@link jcifs.util.Hexdump#toHexString(int val, int
* size)} but provides a more practical form when trying to avoid {@link
* java.lang.String} concatenation and {@link java.lang.StringBuffer}.
*/
-
public static void toHexChars( int val, char dst[], int dstIndex, int size ) {
while( size > 0 ) {
int i = dstIndex + size - 1;