You are not logged in.
Announcement
Unanswered posts
|
Pages: 1
hi,
Sure i'm missing something important !
but it seems that Talend 's never gone in "my code" :
just a few ligne of code in main part :
<%
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
INode node = (INode)codeGenArgument.getArgument();
String cid = node.getUniqueName();
%>
<%
// recuperer les parametres du GUI
//String filename = ElementParameterParser.getValue(node, "__FILENAME__");
String username = ElementParameterParser.getValue(node, "__USER__");
String password = ElementParameterParser.getValue(node, "__PASS__");
String server = ElementParameterParser.getValue(node, "__SERVER__");
String srcURL = ElementParameterParser.getValue(node,"__SRCURL__");
String destURL = ElementParameterParser.getValue(node,"__DESTURL__");
%>
//jcifs.smb.NtlmPasswordAuthentication theAuth = null;
try{
jcifs.Config.setProperty("jcifs.netbios.wins", <%=server %>);
//if(theAuth == null)
jcifs.smb.NtlmPasswordAuthentication theAuth = new jcifs.smb.NtlmPasswordAuthentication(<%=server %>, <%=username %>, <%=password %>);
jcifs.smb.SmbFile sf = new jcifs.smb.SmbFile(<%=server %> + <%=srcURL %>, theAuth);
jcifs.smb.SmbFileInputStream in = new jcifs.smb.SmbFileInputStream(sf);
java.io.File file = new java.io.File(<%=destURL %>);
java.io.OutputStream out = new java.io.FileOutputStream(file);
if(sf.exists()){
System.out.println("entree boucle if");
//byte[] buff = new byte[1024];
int len;
while((len = in.read()) != -1)
out.write(len);
}
else
System.out.println("fichier smb n'existe pas" );
in.close();
out.close();
}
catch(jcifs.smb.SmbException e){
System.out.println(e.getMessage());
}I've add some out.println method to see where run is ... but nothing appear in the console !!
And any data is read/write from a "smb" file to a local file ...but have any compilation or generated errors ..
I can find the reason why and where to look for .. so i need your help .. again ![]()
Ps: perhaps you nedd more informatio about properties componenet
Offline

looking for something like : [Bugtracker, bug 5503, fixed] Add support for Samba protocol in tFileFetch and [Subversion] r19650 ?
Offline
hi, mhirt
good news ... !!!
i'm going to have a look at the source code (in my ' trunk ' ) , and find why my code doesn't work !!
but source code poined in the second link are similar with mine ... except that mine doesn't work of course (lol) ..where is the coma less !?
PS: I had choiced "Smb protocole" for training on "creation of new componenent" for the fisrt one ... i was thought a simple one !!
thank !
I gonna keep on searching ...
Offline

Hello,
I think it's a very good first example.
The code is simpler enough to easily understand the first keys of component development.
Nevertheless, don't hesitate to ask if yoiu don't find your answer.
Regards,
Mike.
Offline
Pages: 1