https://github.com/vbauer/commons-vfs2-cifs
SMB/CIFS provider for Commons VFS
https://github.com/vbauer/commons-vfs2-cifs
cifs-provider commons-vfs2-cifs java jcifs smb
Last synced: 7 months ago
JSON representation
SMB/CIFS provider for Commons VFS
- Host: GitHub
- URL: https://github.com/vbauer/commons-vfs2-cifs
- Owner: vbauer
- Created: 2012-08-01T11:14:58.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2018-11-15T19:32:35.000Z (over 7 years ago)
- Last Synced: 2025-06-24T13:41:43.306Z (10 months ago)
- Topics: cifs-provider, commons-vfs2-cifs, java, jcifs, smb
- Language: Java
- Size: 47.9 KB
- Stars: 10
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# commons-vfs2-cifs
[](https://travis-ci.org/vbauer/commons-vfs2-cifs)
[](http://opensource.org/licenses/Apache-2.0)
[](https://jitpack.io/#vbauer/commons-vfs2-cifs)
[](https://www.codacy.com/app/bauer-vlad/commons-vfs2-cifs)
[Commons VFS](http://commons.apache.org/proper/commons-vfs/) provides a single API for accessing various different file systems. It presents a uniform view of the files from various different sources.
Project "commons-vfs2-cifs" is a SMB/CIFS provider for Commons VFS.
## Requirements
Project "commons-vfs2-cifs" requires:
* [JCIFS library](http://jcifs.samba.org)
* Java 8
## Setup
Gradle:
```groovy
repositories {
maven {
url "https://jitpack.io"
}
}
dependencies {
compile 'com.github.vbauer:commons-vfs2-cifs:1.2.0'
}
```
Maven:
```xml
jitpack.io
https://jitpack.io
com.github.vbauer
commons-vfs2-cifs
1.2.0
```
## Example
```java
// Retrieve file system manager
final FileSystemManager fileManager = VFS.getManager();
// Configure authenticator
final FileSystemOptions fileSystemOptions = new FileSystemOptions();
final StaticUserAuthenticator userAuthenticator =
new StaticUserAuthenticator(domain, login, password);
DefaultFileSystemConfigBuilder.getInstance()
.setUserAuthenticator(fileSystemOptions, userAuthenticator);
// Resolve file object file from virtual file system
final String uri = "smb://fs/Documents";
final FileObject fileObject = fileManager.resolveFile(uri, fileSystemOptions);
```
## Known Issues
To date, JCIFS has always tried NetBIOS broadcast lookups in favor of DNS which frequently resulted in a 6 second
delay if the jcifs.resolveOrder property was not adjusted. This behavior has been changed to try DNS before NetBIOS
broadcast lookups which should result in much less frequent delays when using default settings. To restore the old
behavior, simply set **jcifs.resolveOrder=LMHOSTS,BCAST,DNS**.
## Might also like
* [jconditions](https://github.com/vbauer/jconditions) - Extra conditional annotations for JUnit.
* [jackdaw](https://github.com/vbauer/jackdaw) - Java Annotation Processor which allows to simplify development.
* [houdini](https://github.com/vbauer/houdini) - Type conversion system for Spring framework.
* [herald](https://github.com/vbauer/herald) - Logging annotation for Spring framework.
* [caesar](https://github.com/vbauer/caesar) - Library that allows to create async beans from sync beans.
* [avconv4java](https://github.com/vbauer/avconv4java) - Java interface to avconv tool.
## License
```
Copyright 2014 Vladislav Bauer
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```