JProgressBar,how to update in file transfer?

Hi ..
I have the following copy code that uses java nio package, how to update jProgressBar to indicate movement in file transfer?
I needn't use progress monitor...
    public static void copyFile(File sourceFile, File destFile) throws IOException {
if(!destFile.exists()) {
  destFile.createNewFile();
FileChannel source = null;
FileChannel destination = null;
try {
  source = new FileInputStream(sourceFile).getChannel();
  destination = new FileOutputStream(destFile).getChannel();
  destination.transferFrom(source, 0, source.size());
//JOptionPane.showMessageDialog(null, destination.position());
finally {
  if(source != null) {
   source.close();
  if(destination != null) {
   destination.close();
    }Thanks..
Feras

Inorder to update your progress bar, you have to have it in a different thread and update it--you also have to do the copy in segmented fashion... if you have one stream running continuously, then you cannot update anything.

Similar Messages

  • How to update html file in clob column in oracle

    hi,
    please help me how to update html file in clob column in oracle
    Thanks

    This is your main query as i am able to understand and you want to update your html file into terms columns based on conditions :
    SELECT     b.terms As terms
             FROM chklst_item_x_enrlmnt_type a, prvdr_enrlmnt_agreement b
            WHERE a.enrlmnt_type_cid = 1
              AND a.chklst_item_cid = b.chklst_item_cid
              AND a.chklst_item_cid = 79
              AND a.oprtnl_flag = 'A'
              AND b.oprtnl_flag = 'A'
              AND TRUNC (SYSDATE) BETWEEN b.from_date AND b.TO_DATE;So i suggest below one but you need to create a directory where you can store your html file and then you can update .. And remaining consult Experts suggestions too as your
    question is improperly posted . . .
    DECLARE
       vclob     CLOB;
       v_bfile   BFILE := BFILENAME ('YOUR_DIR', 'filename.html');
    BEGIN
       SELECT     b.terms
             INTO vclob
             FROM chklst_item_x_enrlmnt_type a, prvdr_enrlmnt_agreement b
            WHERE a.enrlmnt_type_cid = 1
              AND a.chklst_item_cid = b.chklst_item_cid
              AND a.chklst_item_cid = 79
              AND a.oprtnl_flag = 'A'
              AND b.oprtnl_flag = 'A'
              AND TRUNC (SYSDATE) BETWEEN b.from_date AND b.TO_DATE
       FOR UPDATE;
       DBMS_LOB.fileopen (v_bfile);
       DBMS_LOB.loadfromfile (vclob, v_bfile, DBMS_LOB.getlength (v_bfile));
       DBMS_LOB.fileclose (v_bfile);
    END;
    / Regards..

  • HOw to update XML file residing in DAM by component JSP in run-time?

    i have made a component which reads xml file residing in DAM.
    Content Author can fill some values in dialog of this component, as soon as author provide the values,i have to update these values in XML file and component reloadsby reading the updated xml file.
    i am trying to achieve this by making object of XML file and giving it's path., but i ma unable to access the XML file.
    Can anyone help me out to how to update XML file by component JSP in run-time?

    Now the changed data must be exported back into the XML file, meaning that the content of certain elements must be updated. How can this be done with XSLT?
    XSLT approach:  check these online tutorial
    http://www.xml.com/pub/a/2000/08/02/xslt/index.html
    http://www.xml.com/pub/a/2000/06/07/transforming/index.html
    ABAP approach:
    for example you have the xml (original) in a string called say xml_out .
    data: l_xml  type ref to cl_xml_document ,
            node type ref to if_ixml_node  .
    create object l_xml.
    call method l_xml->parse_string
      exporting
        stream = xml_out.
    node = l_xml->find_node(
        name   = 'IDENTITY'
       ROOT   = ROOT
    l_xml->set_attribute(
        name    = 'Name'
        value   = 'Charles'
        node    = node
    (the above example reads the element IDENTITY and sets attribute name/value to the same)
    like wise you can add new elements starting from IDENTITY using various methods available in class CL_XML_DOCUMENT
    so how do I access the XML file in order to update it?
    you have already read this XML into a ABAP variable right?
    Sorry couldnt understand your whole process, why do you need to read local XML file?
    Raja

  • Can't find how to shut off File Transfer Mode with...

    I've spent the better part of two hours searching the Internet for information on how to turn off File Transfer Mode since my phone started refusing to connect to my home computer, today.
    The pdf user's guide doesn't say how to find it.  I've been digging through the menu on the phone trying to find anything that resembles File Transfer Mode so I can click it off.
    The other FAQ and discussion groups I've located are irrelavent as the information they contain doesn't transfer to my Nokia 820 (they suggest options which don't exist on my phone).
    Please, where does one start looking for File Transfer Mode on this phone so they can shut it off, and why isn't that information printed in the troubleshooting documents and self help files for these phones?
    I connect through the USB cable to my PC.  I have downloaded and installed Nokia PC Suite v.7.1.180.94 this morning in hopes that it would fix the connectivity problem, but unless I can get File Transfer Mode shut off somehow, my new phone's going to wind up being useless.
    Nokia Lumia 820, Windows 8 phone
    HP Pavilion Slimline s52021, Windows 7 Home

    have you searched these forums and tried a soft reset (pressing the volume down and power buttons together until the phone vibrates)? Bear in mind that no, Nokia Suite, or Nokia PC Suite do not work with Windows Phone 8 devices at all, only the Windows Phone app does.
    See if other devices connect to your PC, and try other USB ports.

  • How to update XML file through UCCX script ?

    Hi,
    I have an UCCX script with MENU step. One of the step is for technical support team. When caller chose this step, information about date and time of the call and calling number should be recorded on a XML file located on the web server.
    This XML is uploaded into the web server , but I don't know how to update it through UCCX script.
    Here is how the XML file looks like:
    <?xml version="1.0" ?>
    <rss version="2.0">
    <channel>
    <title>CALL LOG</title>
    <link></link>
    <description>Support Call log</description>
    <ttl>1</ttl>
    <item>
    <title>2011-08-24 14:56:39 - 00044 123 123 123</title>
    <link></link>
    <description></description>
    </item
    </channel>
    </rss>
    Any idea?
    Thanks,
    O

    Hi
    The 'keyword transform' step uses the template XML file to generate the actual XML file you want to post... the template would be a plain text file uploaded to the repository, and would look like so:
    <?xml version="1.0" ?>
    CALL LOG
    Support Call log
    1
    %%calldatetime%% - %%clinumber%%
    Now - if you had that bit of XML, with correct time/number in it - have you verified know that you can definately just post that XML to a certain URL to get it on the server? Check with whoever manages that server exactly what you need to do to get it to appear - then worry about how you do that from UCCX. It may not be a matter of posting up that XML, you may need it in a different format or something..
    Aaron

  • How to update "Estimated File Size"

    As I fiddle around with my Export Settings (CS4), I don't see any update in the "Estimated File Size" info at the bottom left of the screen.
    It seems to me that as I move the Target Bitrate and Maximum bitrate (as well as the other options), I would see the Estimated File size increase or decrease so I can have real time feedback on my settings.
    Is there a setting I need to change or a command I need to make in order to see an updated "Estimated File Size"?
    Thanks
    ...Rowby

    Nevermind. I see that the sliders do indeed give me a reak time updated file size.  Don't know how I missed it.
    Rowby

  • How to Update Jar Files

    Can u tell me how to update an JAR file .
    I have a jar file ,I would like to add a class in that jar.
    I am able to add it but it goes
    into the root folder where as i want it go in one of the sub folder.
    Eg
    TEST.JAR
    The structure is
    Server\a.class
    Server\folder1\b.class
    Server\folder2\c.class
    Now when i add the class it goes to
    Server\a.class
    Server\folder1\b.class
    Server\folder2\c.class
    my.class
    where as i want it to go in
    Server\folder1\my.class

    Show the code you use to add it to the JAR, and we will attempt to fix it. Don't forget to put it around [code]  tags

  • How to see the  file transfer speed on a mac

    Hi, I'm kind of a beginner with a Mac, I have worked on windows for all this years and now I have a small dilema. Can someone please tell me how you can see the file transferring speed on a mac. When you copy and paste from one drive to another, or from time capsule to my mac, etc a dialog appears showing you a progress bar and the time remaining. I would also like to see the speed of the transfer. Is it posible to see this variable?

    In windows - vista when you copy or paste a folder from one location to another in the file transfer pop-up you can see the speed of the transfer.(You must press the more details arrow on that pop-up). Does Leopard has any configuration for this kind of information.
    I will try iGet and write here my feedback.

  • How to update the file in simple java archive file on Netweaver2004s

    We have a J2EE application containing few properties file packed inside a java archive. These properties are Configuration properties which we are required to change few times after deployment.We are using SAP Visual Administrator to deploy\undeploy our application.We found out that Visual Administrator dose not support update of files packed in a simple Java Archive in Single File Update Option. It only allows updates of EJB Modules archive.
    Please let us know if there is any other way we can update a file inside a simple java archive.

    Well, Thanks for the help but,. i didn't understand
    try not opening the file every time. As I only know that I need to open a file if i would like to update the records..
    The update is not happening :
    Firstly it shows like this (new.txt):
    STOPSecondly it must show like this (new.txt) BUT NOT HAPPENING AS I EXPECTED:
    STOPSTOPBut it's not hapenning

  • How do I see file transfer speeds?

    Hey guys, does anyone know if it's possible for me to see file transfer speeds instead of just the time remaining in Finder?

    Hi,
    In song view, go to menu > view > view options and select bit rate, file type and size.
    In preferences, you can change import settings to Apple lossless. When you use file > create new version you can now can now convert from aiff to lossless.
    Create playlist based of file type being lossless.
    Jim

  • How to set the file transfer mode to binary

    Hi,
    I have a requirement to upload files from local machine to server, and it is working fine.
    But after uploading files junk characters are entered after each line, so want to set the file transfer mode to binary to get rid from this error.
    We have checked that if we ftp the files manually then also getting the same problem when the transfer mode is not selected as binary.
    Please give your valuable advice.
    Thanks,
    Ranita

    Hi,
    I want to set the file transfer mode through controller code, presently I am using the below code where no file transfer mode is specified ::
    public void upLoadFile(OAPageContext pageContext,OAWebBean webBean)
      String serverPath = null;
      OAApplicationModuleImpl am = (OAApplicationModuleImpl)pageContext.getApplicationModule(webBean);
       try {              
          Connection conn = am.getOADBTransaction().getJdbcConnection();     
          String query = "select  distinct variable_name, value from fnd_env_context where variable_name = 'XXCUST_TOP' and concurrent_process_id = ( select max(concurrent_process_id) from fnd_env_context )";
          PreparedStatement stmt = conn.prepareStatement(query);
           for (ResultSet resultset = stmt.executeQuery();
                          resultset.next(); )
                 serverPath  = resultset.getString("value");
            stmt.close();  
           catch(Exception ex)
             throw new OAException(ex.getMessage(), OAException.ERROR);
       String filePath = serverPath+"/"+pageContext.getParameter("FileType");
       //System.out.println("Default File Path---->"+filePath);
       String fileUrl = null;
       try
        DataObject fileUploadData =  pageContext.getNamedDataObject("MessageFileUpload");
      //FileUploading is my MessageFileUpload Bean Id
        if(fileUploadData!=null)
         String uFileName = (String)fileUploadData.selectValue(null, "UPLOAD_FILE_NAME"); 
         String contentType = (String) fileUploadData.selectValue(null, "UPLOAD_FILE_MIME_TYPE");  
         //System.out.println("User File Name---->"+uFileName);
         FileOutputStream output = null;
         InputStream input = null;
         BlobDomain uploadedByteStream = (BlobDomain)fileUploadData.selectValue(null, uFileName);
         //System.out.println("uploadedByteStream---->"+uploadedByteStream);
         File file = new File(filePath, uFileName);   //C:\\Ranita
         //System.out.println("File output---->"+file);
         output = new FileOutputStream(file);
         //System.out.println("input---->"+input);
         byte abyte0[] = new byte[0x19000];
         int i;
         while((i = input.read(abyte0)) > 0)
         output.write(abyte0, 0, i);
         output.close();
         input.close();
         HashMap map = new HashMap();
         map.put("fromPage","Y");
         pageContext.forwardImmediatelyToCurrentPage(map,true,OAWebBeanConstants.ADD_BREAD_CRUMB_YES);
       catch(Exception ex)

  • How to update XML file from the program

    i am new in abap , and i have the following issue,so plz anyone who knows how to do it
    Background :
    An XML file is used as the datasource for a Flex Application. From time to time this requires updating with new staff details.
    i have already saved the xml file in the c drive with the name C:\AdvAC\AC1\bin-debug\assets\staff
    Requirement :  Write a Dialog transaction with the following text input fields.
    Reference Indicator.     (Char10)
    Staff No          (NUMC, Length 5)
    Name               (Char50)
    Room               (Numc, length 3)
    Phone               (Numc Length 7)
    Mail               (char30)
    in screen 100
    The transaction should also have an u201CUpdate Fileu201D button, which when pressed :
    1) Loads the file C:\AdvAC\AC1\bin-debug\assets \ into an ITAB.
    2) Inserts the data into the ITAB using the following XML format.
    <staff>
    <ref_ind> Reference Indicator.</ref_ind>
    <staff_no> Staff No </staff_no>
    <name> Name </name>
    <room> Room </room>
    <phone> Phone </phone>
    <mail> Mail </mail>
    </staff>
    all should be inside  <allstaff> </allstaff> tagsu2026.
    Writes the ITAB back to the file.
    thanx all

    this is what i have done but i dont know how to do the rest. i will apprecite any help from u.
    Edited by: man700s on Feb 16, 2010 6:58 AM
    REPORT  Z_XML_FILE_UPDATE.
    TYPES: BEGIN OF ts_staff,
             REF_IND(10)  TYPE c,
             Staff_No(5)  TYPE c,
             Name(50)     TYPE c,
             Room(3)      Type n,
             Phone(7)     Type n,
             Mail(30)     Type c,
           END OF ts_staff.
    DATA: t_staff TYPE TABLE OF ts_staff WITH HEADER LINE.
    DATA: w_staff Type ts_staff.
    DATA T_STRING TYPE TABLE OF STRING.
    DATA W_STRING TYPE STRING.
    call SCREEN 100.
    PERFORM upload_xml_file.
    PERFORM update_xml_tab.
    *PERFORM download_xml_file.
    MODULE USER_COMMAND_0100 INPUT.
    W_STRING = '<allstaff>'.
      APPEND w_string to t_string.
      loop at t_staff into w_staff.
      w_string ='<staff>'.
      APPEND w_string to t_string.
      if T_staff-Ref_Ind = 'X'.
      CONCATENATE '<Ref_Ind>' w_staff-Ref_Ind '</Ref_Ind>' into w_string.
      APPEND w_string to t_string.
      ENDIF.
      if T_staff-staff_no = 'X'.
      CONCATENATE '<staff_no>' w_staff-staff_no '</staff_no>' into w_string.
      APPEND w_string to t_string.
      ENDIF.
      if T_staff-name = 'X'.
      CONCATENATE '<name>' w_staff-name '</name>' into w_string.
      APPEND w_string to t_string.
      ENDIF.
    if T_staff-room = 'X'.
      CONCATENATE '<room>' w_staff-room '</room>' into w_string.
      APPEND w_string to t_string.
      ENDIF.
      if T_staff-phone = 'X'.
      CONCATENATE '<phone>' w_staff-phone '</phone>' into w_string.
      APPEND w_string to t_string.
      ENDIF.
      if T_staff-mail = 'X'.
      CONCATENATE '<mail>' w_staff-mail '</mail>' into w_string.
      APPEND w_string to t_string.
      ENDIF.
      w_string = '</staff>'.
      append w_string to t_string.
    ENDLOOP.
      W_STRING = '</allstaff>'.
      APPEND w_string to t_string.
    ENDMODULE.               
    Edited by: man700s on Feb 16, 2010 7:01 AM

  • How to update image files in web pages generated by servlet without redeploying

    HI,
    I have a servlet which generates html pages with images. Those images changes
    as they are graph generated regularly. They are placed in s directory where the
    application is deployed. It is necessary because I have made some security constraints
    for the location of those files. However it seems that when I deploy my application
    on WLS all files contained in the application directory are cached, and when for
    ex. I delete some of them they are still appear in generated html pages. only
    Redeployment of application updates the state of those files.
    Is there a way to make the application to be aware of any changes in images files
    and to load updated ones??
    i would be interested in a situatioin like with default WLS servelt (DefaultWeb
    Application) where any new files are seen as soon as they are placed in Default
    WebApplication directory.
    Is there a way to periodically redeploy application from CLI?
    thx in advance
    Michal

    889096 wrote:
    Hello!
    In SQL Developer when we run htp package then we see the generated code in OWA Output, But how to invoke or show the webpage by Oracle tools/plsql program.
    and
    Without copying the code and save it to textfile.html and open it with browser.
    I heard it is possible by configuring Apache server.
    Please give me brief details, as i am beginner with ORACLE 10g
    And
    If you are using the htp package, you are presumably developing for an application server? Can the people who set that up not help you with your development environment?
    Setup is too complicated to cover here. Check out the Oracle HTTP Server documentation on oracle's documentation pages.
    Briefly, you need to install Oracle HTTP Server and then configure a data access desciptor to connect to your database.
    How to see the generated code in "QUEST TOAD"? I am not able to see OWA output in TOADYou will have to ask this question in a Toad forum.

  • How to update XML file using XSLT

    Hi there,
    I have a "small" issue with exporting data to an XML file using XSLT.
    A two steps process is needed to import data from a non-hierarchical XML file into ABAP, change the data, and then update the XML file with new values. The problem is not trivial, since the format of the XML file is a complex one: there are many interdependent elements on the same level, pointing to each other by using id and ref attributes. Based on these values the data can be read and written into an internal table. I use XSLT and XPath for that. So the inbound process is done and seems to work correctly. I have to mention that the file contains much more data than I need. I am working only with a small part of it.
    Now the changed data must be exported back into the XML file, meaning that the content of certain elements must be updated. How can this be done with XSLT? I can pass only the internal table to the transformation, so how do I access the XML file in order to update it? I have tried to use the <B>xsl:document()</B> function to access the content of the file store locally on my PC, but it fails each time by throwing and URI exception. I have tried the absolute path without any addition and the path with the file:/// addition. Same result. Please advise.
    Many thanks,
    Ferenc
    P.S. Please provide me with links only if they are relevant for this very matter. I will not give points for irrelevant postings...

    Now the changed data must be exported back into the XML file, meaning that the content of certain elements must be updated. How can this be done with XSLT?
    XSLT approach:  check these online tutorial
    http://www.xml.com/pub/a/2000/08/02/xslt/index.html
    http://www.xml.com/pub/a/2000/06/07/transforming/index.html
    ABAP approach:
    for example you have the xml (original) in a string called say xml_out .
    data: l_xml  type ref to cl_xml_document ,
            node type ref to if_ixml_node  .
    create object l_xml.
    call method l_xml->parse_string
      exporting
        stream = xml_out.
    node = l_xml->find_node(
        name   = 'IDENTITY'
       ROOT   = ROOT
    l_xml->set_attribute(
        name    = 'Name'
        value   = 'Charles'
        node    = node
    (the above example reads the element IDENTITY and sets attribute name/value to the same)
    like wise you can add new elements starting from IDENTITY using various methods available in class CL_XML_DOCUMENT
    so how do I access the XML file in order to update it?
    you have already read this XML into a ABAP variable right?
    Sorry couldnt understand your whole process, why do you need to read local XML file?
    Raja

  • How to update photoshop files in DW8

    I had purchased a template from dreamtemplates.com #0064 to
    save me some time and get my site up sooner. I do not have a url
    yet to show you all. The template came with the images prepared in
    photoshop included in a psd file along with the images and html
    files. I was told to just doubleclick the psd file in dreamweaver
    and when photoshop opened edit the layers with the new text I
    wanted and then save to web. I have a good looking set of images
    now with the text I wanted in the pictures but save to web left me
    with 0064.html a file I can look at but not edit in dreamweaver. I
    thought when you saved to web it would update all of the image and
    html files so I could finish developing the site.
    If you can figure out how to get this to work please clue me
    in. It looks like the template shortcut with photoshop pictures is
    perhaps the long way around however it has made me look at
    everything and it got me here.

    >>I have a good looking set of images now with the
    >> text I wanted in the pictures but save to web left
    me with 0064.html a
    file I
    > >can look at but not edit in dreamweaver.
    Can you upload that file (0064.html) to your web host and
    then give us a
    link so we can review the page and its underlying code? Then,
    we might be
    able to help you.
    >>I was told to just doubleclick the psd
    >> file in dreamweaver and when photoshop opened edit
    the layers with the
    new text
    > >I wanted and then save to web
    That's a red flag. Building a page in an image editor (e.g.
    Photoshop) and
    then "saving to web" is a terrible way to build web sites.
    You should only
    use Photoshop and the like to build the images. Page layout,
    text, etc.
    should be assembled in DW.
    BTW there is no website
    http://www.dreamtemplates.com/.
    What is the correct
    name and URL for the company you bought the template from?
    Walt
    "phoenixmentor" <[email protected]> wrote in
    message
    news:e5qt97$h96$[email protected]..
    > I had purchased a template from dreamtemplates.com #0064
    to save me some
    time
    > and get my site up sooner. I do not have a url yet to
    show you all. The
    > template came with the images prepared in photoshop
    included in a psd file
    > along with the images and html files. I was told to just
    doubleclick the
    psd
    > file in dreamweaver and when photoshop opened edit the
    layers with the new
    text
    > I wanted and then save to web. I have a good looking set
    of images now
    with the
    > text I wanted in the pictures but save to web left me
    with 0064.html a
    file I
    > can look at but not edit in dreamweaver. I thought when
    you saved to web
    it
    > would update all of the image and html files so I could
    finish developing
    the
    > site.
    > If you can figure out how to get this to work please
    clue me in. It looks
    like
    > the template shortcut with photoshop pictures is perhaps
    the long way
    around
    > however it has made me look at everything and it got me
    here.
    >

Maybe you are looking for