How I can prevent when file in use??

Hi all friends,
I am facing problem with my uploading software it is a automatic process of uploading only user copy the file in hot folder of my software and software takes the file one by one automatically and start uploading on destination and it also shows the name and size of file on text area of my swing my interface for user information which file it is uploading.Now my problem is when user copy the file from network computer in that folder in between copy my software shows the file name and size(which is incomplete size)on text area of swing interface and after completion of copy it shows the complete size and name of same file again.But it couldn't read the file coz sharing violation.My software checks its folder for file every after 30 seconds and I have done it by therads.I want to prevent my software so that it can't take the file name and size in between copy of that file means it can't show name and size of incomplete file.Can any one plz guide me how i can do that.Iam pasting those portion of my codes:-
Upload.addActionListener(new ActionListener()
     public void actionPerformed(ActionEvent e)
try{                      
myThread = new Thread ()
public void run () {
while (true) {
     checkForFilesToUpload ("d:\\DTMS\\Input\\");
try{
this.sleep (30000);
}catch(Exception nx){}
myThread.start();
}catch(Exception exp) {
Error("Error : " + exp.toString());
//checkForFilesToUpload method(those portion only)
for (int k = 0; k < fileList1.size(); k++)
filen = (File)fileList1.get(k);
filename=filen.getName();
filesize=filen.length();
filesizeinKB=filesize/1024;
textArea1a.append
(i+"."+" "+" "+filename+"\n");
textArea1b.append(filesizeinKB+" KB"+"\n");
i=i+1;
Regards
Bikash

On JDK 1.4 you could try to lock the file (via java.nio.channels.FileLock). But be warned: It is not supported on all platforms. I think there was an article about nio covering file locking on www.onjava.com (I was right: Just googled and found http://www.onjava.com/pub/a/onjava/2002/10/02/javanio.html ).

Similar Messages

  • When someone other than myself downloads an image from my web album, a dynamically generated file name replaces the original file name.  How I can prevent the original file name being replaced during the downloading process?

    When someone other than myself downloads an image from my web album, a dynamically generated file name replaces the original file name.  How I can prevent the file name being changed during this downloading process?

    Hi Glenyse,
    Here are my steps.
    1.  I upload multiple image (jpg) files onto my photo album.
    2.  I select the "sharing" by email option for this album.
    3.  I enter the recipient's email address.
    4.  The recipient receives my message and clicks on the link.
    5.  The recipient accesses my photo album and clicks on one of the images.
    6.  The image opens up to its own screen.
    7.  The recipient selects the "download" and then save file option.
    Here is the part I do not understand.  For some reason, during this "download" process, the original name which I have given to the file is replaced by different name.  So I was hoping that someone knows how to prevent the file name from being changed during the "download and save" process.
    Much appreciated if you can help me find a solution to this problem.
    Mary  

  • Having a problem with dates when I send my numbers doc to excel. dates are all out and that they have to cut and paste individual entries onto their spreadsheet. Any idea how I can prevent this

    having a problem with dates when I send my numbers doc to excel. dates are all out and that they have to cut and paste individual entries onto their spreadsheet. Any idea how I can prevent this.
    I'm using Lion on an MBP and Numbers is the latest version

    May you give more details about what is wrong with your dates ?
    M…oSoft products aren't allowed on my machines but I use LibreOffice which is a clone of Office.
    When I export from Numbers to Excel and open the result with LibreOffice, the dates are correctly treated.
    To be precise, dates after 01/01/1904 are correctly treated. dates before 01/01/1904 are exported as strings but, as it's flagged during the export process, it's not surprising.
    Yvan KOENIG (VALLAURIS, France) mardi 3 janvier 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : http://public.me.com/koenigyvan
    Please : Search for questions similar to your own before submitting them to the community
    For iWork's applications dedicated to iOS, go to :
    https://discussions.apple.com/community/app_store/iwork_for_ios

  • Question -  how i can prevent assembly order rescheduling when in VA02 ?

    Hi                                             ( ECC 6.0)
    I am working with assembly orders.  In sales order create - the system creates an assembly order - requirements type = dynamic order.
    If i amend the sales order a few days later - the system reschedules the assembly order - even when the assembly order is started and has status REL = released.  I get error CO061 - start date in past.. as the system first backwards reschedules and then reschedules forwards.
    Question -  any ideas how i can prevent assembly order rescheduling when in sales order change VA02 ? I need the system  to check the production order status and if = REL then prevent the rescheduling.  Putting a change block on the production order does not work as it ultimately breaks the link between sales:assembly order.
    I am thinking i need to use an SD user exit to read the assembly order and prevent order changes if the assembly order is = REL.
    thanks in advance
    Graham.

    Hi Ram
    We are using dynamic link.  My original solution was to set the 'nochange' on release- however if the sales order qty changed - or the dates changed - or indeed any ATP check was performed - the link was sometimes lost - dependant on user keystrokes.  VA02 still calls assembly order change in this scenario - and the user gets the mesage that no change is present - and ATP returns 0 qty.
    What I think i can use is user exit  EXIT_SAPLCOEXT_001 in conjunction with a user status.  I plant to set the status 'block' on release - although configure it to have no action.  In the user exit - called in the interface between sales / assembly order - I plan to check the assembly order for this status and set the error condition if the status is set.  In debug mode - setting the eror manually - this appears to work as the system never calls assembly order change and accepts the assembly order date/qty as 'supply' in the atp check.
    thanks for you assistance.
    regards
    Graham

  • I am sharing a apple id acount with my family but when i synced my phone to the computer it erased all of my imformation and put the other phone's imformation on it. I was wondering how I can prevent this from happening?

    I am sharing a apple id acount with my family but when I synced my iphone to the computer it erased all of my imformation and put the other phone's imformation on it. I was wondering how I can prevent this from happening?

    If the ringtones are on the old device just plug it in and do a transfer of purchases then they will be on the computer to sync to the new device.

  • Does anyone know how i can view PDF files using Galaxy Note 2?

    Does anyone know how i can view PDF files using Galaxy Note 2?
    This is what i have been doing;
    I click on the file i wish to view (via a portal)
    this file goes to notification widget (i drag down screen)
    notification/message says download complete
    i click on notification/message
    nows it says complete action using (here i only have 2 icon options 1= DB Text Editor 2 = HTML Viewer)
    I have installed Adobe Reader.

    Can you confirm if the downloaded file is a pdf file, that is it ends with .pdf?

  • Good day! When saving a file in Illustrator, I can not keep the older version. How You can save the file in an older version?

    Good day! When saving a file in Illustrator, I can not keep the older version. How You can save the file in an older version?

    When you save a file that's what options offers application
    05 мая 2014 г., в 13:40, Jacob Bugge <[email protected]> написал(а):
    sage go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    To unsubscribe from this thread, please visit the message page at . In the Actions box on the right, click theStop Email Notifications link.

  • How I can sort music files (audiobook) in music player on iPhone by file name, not by title name?

    I have audiobook of abt.500 files, all titles are the name of the book. iPhone music player does not understand sorting by file names, but by title, hterfore it plays files chaotic. So, how I can sort audiobook files in music player by file name, not by title name?

    I have the same problem.
    I've went through the pains of merging all chapters into one big file for each and every audiobook, so that at least the chapters don't get played in random order. Month and month of work….. In iTunes 12.01. I can now order my audiobooks by title or by author.
    But once they're uploaded to my blo*dy expensive iPhone 6Plus 128 (which I bought especially to have all my music and my audiobooks on one device) my audiobooks are NOT sorted by author, but by Title.
    So, let's say I have 15 books by Ken Follet, they don't appear as Ken Follet > Title of the book but they are sorted alphabetically with all the other titles of other authors.
    iPods where originally designed for music and audiobooks, but each and every version of iOS makes handling your music and especially your audiobooks harder and harder….
    I am very disappointed and after so many years of using apple, I am considering to move on to android devices.

  • How we can open pdf files in epic browser in English

    how we can open pdf files in epic browser in English
    message is appearing in epic browser during opening pdf files in browser " The adobreader /acrobat reader is running cannot be used to view pdf files , please exit and try again "

    I already fixed it. I never exited out of Firefox before deleting the mime file. it works now.

  • I want to open a radio file that is .rm.  I get a message that says I need additional Quicktime software, but I cannot locate what I need to download on the QT website.  Anyone got ideas about how I can open this file?

    I want to open a radio file that is .rm.  I get a message that says I need additional Quicktime software, but I cannot locate what I need to download on the QT website.  Anyone got ideas about how I can open this file?

    Hi bert,
    the ".rm" extension is created by 'Real Media' application.
    The easiest way to use it is to install the 'Real Media' player:
    1. RealPlayer BBC.app
    2. RealPlayer 12.app
    I have both installed & use them sometimes.
    (The 'BBC' wersion doesn't have any adverts with-in the app.)

  • How I can store Image file in a database

    Can any one how i can stored image file in a database and then by using same database how i can show in HTML page...(in a browser)

    This is not something that can be answered easily. There is quite alot of code involved....
    To get started I suggest you read up on the built-in package 'DBMS_LOB' from Oracle . Most of what you need you should find there.
    regards Dave.

  • HOW I CAN OPEN .VOB FILES

    HOW I CAN OPEN .VOB FILES FROM QUICK TIME TO CONVERT FOR IPOD VIDEO?

    .VOB files are MPEG-2 format. QuickTime can't play them without the help of the MPEG-2 Playback Component ($20) and can't export the audio when "converting".
    MPEG Streamclip 1.5.1 (free) can convert the audio and video to .mp4 format for iPod playback. It even has an iPod preset that changes all of the file settings to iPod specs.

  • How I can delete remained files on phone mem after...

    How I can delete remained files on phone mem after removing apps?
    Because it uses a lot of space and I can't use many apps and it says:
    "Memory card full.remove some files first."

    You cannot delete the default apps. Only those that you have added.
    Default apps wiggle, but they don't delete.

  • How i can burn iso files?

    how i can burn iso file to DVD disk?
    and how i can install kali tools?

    Snir wrote:how i can burn iso file to DVD disk?
    https://wiki.archlinux.org/index.php/Op … D.2C_or_BD
    You're welcome. Please learn to search before posting questions; it is not acceptable in our community, and I am only being tolerant of it because you are new here. As Trilby has asked, please make yourself familiar with the Forum Etiquette.
    Snir wrote:and how i can install kali tools?
    What is "kali tools"? If you want help from others, you need to give information. We're not psychics. Generally you install packages using pacman (either from the repos, using ABS or using the AUR). If this is something specific to Kali linux, it probably is not available for Arch Linux. But without information about exactly what you're talking about, it's hard to say.

  • Hello, I would like to know how I can open a file without downloading it? Thank you

    Hello, I would like to know how I can open a file without downloading it? Thank you

    matrix wrote in message
    news:[email protected]..
    > I tried that, attached is the vi.
    > My actual aim is to allow data to be plotted to the graph 4 24 hours,
    > after which, it should clear the chart and start at the beginning
    > agin.
    > Does this vi do this.
    No. The attached is the simplest way of modifying it to do as you want. I've
    sped things up a little to make it obvious.
    > Will the array be able to keep all the data, is there a way i can do
    > it without arrays, i.e. kind of dynamically, and therefore try to save
    > memory usage.
    You already are. You're making the arrays as you go along so only the memory
    needed for the data that's in the plot is in use at any one time. To do it
    without storing
    arrays at all you'd need to keep retrieving the data from
    the XYgraph, adding the new datapoint and writing it back. Messy and I
    suspect incredibly inefficient.
    You're going to use the memory in any case- a better option would be to
    pre-initialise an array and fill it slowly. At the end of each 24 hour block
    zap all the data and start again without destroying and recreating the
    arrays. Or if you're only doing the 24 hour wipes to save memory, simply
    start again at the start of the buffer woithout erasing the previous data
    and you always have 24 hours of data to liik at once the system's running.
    Do a search for keywords like "pre initialise" or "circular buffer" on
    ni.com
    [Attachment xy-time_modified.vi, see below]
    Attachments:
    xy-time_modified.vi ‏51 KB

Maybe you are looking for

  • How can I see my iPhone on the Shared devices list on sidebar of Finder ?

    I have a Home Network Wireless-N based on a Linksys Broadband Router WRT300N. I have my MacBook Pro and my iPhone, my wife her MacBook, my son a Windows portable and still a Desktop Windows PC. The desktop Windows PC is connected via Ethernet cable d

  • Acrobat XI moving headings when I export

    I just upgraded from Acrobat X to XI Pro. I'm working on a couple documents, and now when I export them to PDF from Word, some of the headings are getting moved around. It seems that when there's a Heading 3 in the Word doc, that heading gets moved d

  • Easy and working firewall.

    Someone may find this one useful, it is a little script that configure the iptables with easy. No need of fancy GUIs and dead easy. A nice simple script. chown it root:root chmod it 744 Edit, run the script, repeat when needed. #!/bin/sh # firewall.s

  • In store yosemite was only as downloaded see

    please how can i reset the log the yosemite is downloaded. when i open app store in purchase i see the OS X yosemite only as downloaded, i can not redownloaded for new install, the yosemite is so buggy

  • How do i open ithmb files on my windows xp OS?

    How do I open ithmb files on Windows XP?