csvwriter to smbfile

Posted on 2014-08-29
Last Modified: 2014-08-29

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);

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?

Question by:jazzIIIlove
    LVL 86

    Accepted Solution

    So what's wrong with

    CSVWriter w = new CSVWriter(new PrintWriter(new OutputStreamWriter(smbfos)),';', CSVWriter.NO_QUOTE_CHARACTER);

    Open in new window

    LVL 12

    Author Closing Comment

    by:jazzIIIlove rookie i am :)

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    twoTwo  challenge 35 72
    Is there any core JDK API for PDF Creation? 5 31
    commonTwo  challenge 63 69
    computer science syllabus 3 40
    For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
    Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
    Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
    This video teaches viewers about errors in exception handling.

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now