Link to home
Start Free TrialLog in
Avatar of jazzIIIlove
jazzIIIloveFlag for Sweden

asked on

csvwriter to smbfile

Hi;

I have a line of code;
CSVWriter w = new CSVWriter(new PrintWriter(filePath),';', CSVWriter.NO_QUOTE_CHARACTER);

Open in new window


This is successful to write the content locally, but i have to give up the idea as i need to write the file to a network share.

String path= targetshare +  filePath.getPath() + ".csv";
                NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(domain, username, password);
                SmbFile smbFile = new SmbFile(path, auth);
                smbfos = new SmbFileOutputStream(smbFile);
 smbfos.write(...)

Open in new window


I can write it to a network share but the content of the file is 1 liner whereas in local one, it is 5 liner as it should be.

So, practically the format is not suitable for network. I need to give up local idea anyway, but what can i do for this need?

I need to have adapt jcifs smb to open cvs, especially for    
public static final char NO_QUOTE_CHARACTER = '\u0000';


Any hand?

Regards.
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jazzIIIlove

ASKER

ah..how rookie i am :)