
Anonymous
Not applicable
2008-10-22
10:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
protocole SMB :: Samba
hi,
Sometime i have to get data from OS windows ; i've got a a samba "partage" with it to retrieve them ... manually.
So it will be helpfully to access those repositories by protocole smb:// .............
thanks for your attention
Sometime i have to get data from OS windows ; i've got a a samba "partage" with it to retrieve them ... manually.
So it will be helpfully to access those repositories by protocole smb:// .............
thanks for your attention
325 Views
6 Replies

Anonymous
Not applicable
2008-10-24
12:27 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Here is a java routine that will help you.
In order to use it, you will need to download the jcifs library from http://jcifs.samba.org/src/ and add it to the routine libraries (Right Click on the routine, Edit Routine Libraries)
If you find it interesting, you can ask for a feature request on tFileFetch component to support smb protocol.
Regards,
Here is a java routine that will help you.
In order to use it, you will need to download the jcifs library from http://jcifs.samba.org/src/ and add it to the routine libraries (Right Click on the routine, Edit Routine Libraries)
If you find it interesting, you can ask for a feature request on tFileFetch component to support smb protocol.
Regards,
// template routine Java
package routines;
import jcifs.smb.*;
import java.io.*;
public class SambaTest {
private static void copySMBFile(String domain, String username, String password, String srcURL, String destFile){
try {
// To connect to a server on a remote subnet the IP address of a WINS server is required to retrieve the target address although DNS names and direct IP addresses are also valid server components within an SMB URL
// jcifs.Config.setProperty( "jcifs.netbios.wins", "192.168.1.220" );
NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(domain, username, password);
//SmbFile(java.lang.String url, NtlmPasswordAuthentication auth)
SmbFile SF = new SmbFile(srcURL,auth);
SmbFileInputStream in = new SmbFileInputStream(SF);
File f2 = new File(destFile);
OutputStream out = new FileOutputStream(f2);
byte[] buf = new byte;
int len;
while ((len = in.read(buf)) > 0){
out.write(buf, 0, len);
}
in.close();
out.close();
} catch(FileNotFoundException ex) {
System.out.println(ex.getMessage());
} catch(IOException e) {
System.out.println(e.getMessage());
}
}
public static void main(String[] args){
SambaTest.copySMBFile("domain", "username", "password", "smb://host/dir/distantfile.txt", "C:/localfile.txt");
}
}
325 Views

Anonymous
Not applicable
2008-10-24
06:08 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks a lot mhirt
I didn't know anything about this library , and it 'll resolve some of my "problems" ...
In fact we're plan to migrate all applications on a OS linux but we can do all things we'd like to. (lol for my frenglish)
never mind , il'll going to try you code right now and effectively a tFileFech Smtp 'll be hepfully for some occasions
... seems to be
I didn't know anything about this library , and it 'll resolve some of my "problems" ...
In fact we're plan to migrate all applications on a OS linux but we can do all things we'd like to. (lol for my frenglish)
never mind , il'll going to try you code right now and effectively a tFileFech Smtp 'll be hepfully for some occasions
... seems to be
325 Views

Anonymous
Not applicable
2008-10-24
06:20 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Time to use the http://talendforge.org/bugs 😉
325 Views

Anonymous
Not applicable
2008-10-28
08:02 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
your code works perfectly ...
I can now retrieve easily any files I want with "SMB" protocole with a tJavaFlex component (so simple)
PS : I've tried to add "a feature" in the bugtracker" but didn't find the way to (sic) !
I can now retrieve easily any files I want with "SMB" protocole with a tJavaFlex component (so simple)
routines.test.SMB_connection.runSMB(context.domain, context.username, context.password, context.srcURL, context.destFile);
PS : I've tried to add "a feature" in the bugtracker" but didn't find the way to (sic) !
325 Views

Anonymous
Not applicable
2008-10-29
07:49 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have create feature request 5503
Regards,
Regards,
325 Views

Anonymous
Not applicable
2008-10-30
05:01 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks a lot
Regards
laurent
Regards
laurent
325 Views
