35
35
import org .springframework .util .StringUtils ;
36
36
37
37
/**
38
- * Implementation of the {@link Session} interface for Server Message Block (SMB)
39
- * also known as Common Internet File System (CIFS). The Samba project set out to
38
+ * Implementation of the {@link Session} interface for Server Message Block (SMB)
39
+ * also known as Common Internet File System (CIFS). The Samba project set out to
40
40
* create non-Windows implementations of SMB. Often Samba is thus used synonymously to SMB.
41
- *
42
- * SMB is an application-layer network protocol that manages shared access to files, printers
41
+ *
42
+ * SMB is an application-layer network protocol that manages shared access to files, printers
43
43
* and other networked resources.
44
44
*
45
- * See <a href="http://en.wikipedia.org/wiki/Server_Message_Block">Server Message Block</a>
45
+ * See <a href="http://en.wikipedia.org/wiki/Server_Message_Block">Server Message Block</a>
46
46
* for more details.
47
47
*
48
- * Inspired by the sprint-integration-ftp implementation done by Mark Fisher and Oleg Zhurakousky.
48
+ * Inspired by the sprint-integration-ftp implementation done by Mark Fisher and Oleg Zhurakousky.
49
49
*
50
50
* @author Markus Spann
51
51
* @author Mark Fisher
@@ -74,7 +74,7 @@ public class SmbSession implements Session<SmbFile> {
74
74
* @param _shareAndDir server root SMB directory
75
75
* @param _replaceFile replace existing files if true
76
76
* @param _useTempFile make use temporary files when writing
77
- * @throws IOException in case of I/O errors
77
+ * @throws IOException in case of I/O errors
78
78
*/
79
79
SmbSession (String _host , int _port , String _domain , String _user , String _password , String _shareAndDir , boolean _replaceFile , boolean _useTempFile ) throws IOException {
80
80
this (new SmbShare (new SmbConfig (_host , _port , _domain , _user , _password , _shareAndDir )));
@@ -179,8 +179,8 @@ public void read(String _path, OutputStream _outputStream) throws IOException {
179
179
}
180
180
181
181
/**
182
- * Writes contents of the specified {@link InputStream} to the remote resource
183
- * specified by path. Remote directories are created implicitely as required.
182
+ * Writes contents of the specified {@link InputStream} to the remote resource
183
+ * specified by path. Remote directories are created implicitely as required.
184
184
* @param _inputStream input stream
185
185
* @param _path remote path (of a file) to write to
186
186
* @throws IOException on error conditions returned by a CIFS server
@@ -241,7 +241,7 @@ public SmbFile write(byte[] _contents, String _path) throws IOException {
241
241
/**
242
242
* Creates the specified remote path if not yet exists.
243
243
* If the specified resource is a file rather than a path, creates all directories leading
244
- * to that file.
244
+ * to that file.
245
245
* @param _path remote path to create
246
246
* @return always true (error states are express by exceptions)
247
247
* @throws IOException on error conditions returned by a CIFS server
@@ -362,7 +362,7 @@ public boolean isOpen() {
362
362
}
363
363
364
364
/**
365
- * Convenience method to write the specified input stream to a remote path and return
365
+ * Convenience method to write the specified input stream to a remote path and return
366
366
* the path as an SMB file object.
367
367
* @param _inputStream input stream
368
368
* @param _path remote path (of a file) to write to
@@ -380,7 +380,7 @@ SmbFile writeAndClose(InputStream _inputStream, String _path) throws IOException
380
380
* @param _path remote path
381
381
* @param _isDirectory Boolean object to indicate the path is a directory, may be null
382
382
* @return SmbFile object for path
383
- * @throws IOException in case of I/O errors
383
+ * @throws IOException in case of I/O errors
384
384
*/
385
385
private SmbFile createSmbFileObject (String _path , Boolean _isDirectory ) throws IOException {
386
386
String path = StringUtils .cleanPath (_path );
@@ -389,7 +389,7 @@ private SmbFile createSmbFileObject(String _path, Boolean _isDirectory) throws I
389
389
}
390
390
391
391
SmbFile smbFile = new SmbFile (smbShare , path );
392
-
392
+
393
393
boolean appendFileSeparator = !path .endsWith (FILE_SEPARATOR );
394
394
if (appendFileSeparator ) {
395
395
try {
@@ -428,10 +428,10 @@ public SmbFile createSmbDirectoryObject(String _path) throws IOException {
428
428
static void configureJcifs () {
429
429
// TODO jcifs.Config.setProperty("jcifs.smb.client.useExtendedSecurity", "false");
430
430
// TODO jcifs.Config.setProperty("jcifs.smb.client.disablePlainTextPasswords", "false");
431
-
431
+
432
432
// set JCIFS SMB client library' log level unless already configured by system property
433
433
final String sysPropLogLevel = "jcifs.util.loglevel" ;
434
-
434
+
435
435
if (jcifs .Config .getProperty (sysPropLogLevel ) == null ) {
436
436
// set log level according to this class' logger's log level.
437
437
Log log = LogFactory .getLog (SmbSession .class );
@@ -445,4 +445,9 @@ static void configureJcifs() {
445
445
}
446
446
}
447
447
448
+ @ Override
449
+ public String [] listNames (String path ) throws IOException {
450
+ throw new UnsupportedOperationException ("Not implemented yet" );
451
+ }
452
+
448
453
}
0 commit comments