File Name Copy (not text inside the file ) and change the extension of file

Hi,
I have a requirement in which I have to copy the file name (not the text inside file ) from one folder/dir to another folder/dir with some another extension.
Suppose we have file abc.txt of 20kb in a folder ,we need this in another folder with abc.done extension of 0 kb.
This I need just to trigger a process.
I have a below code to copy some files from one folder to another but this code copies the complete file not the file name only.Need help.
package com.sumit.collections;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileChannel;
public class FileMove {
     * @param args
     * @throws IOException
     public static void main(String[] args) throws IOException {
          FileMove fm=new FileMove();
          fm.copyFiles();
     public void copyFiles() throws IOException { 
          File destination=new File("C://soft//test2");
          File srcDir = new File("C://soft//test");
     File[] files = srcDir.listFiles();
     FileChannel in = null;
     FileChannel out = null;
     for (File file : files) { 
     try { 
     in = new FileInputStream(file).getChannel();
     File outFile = new File(destination, file.getName());
     out = new FileOutputStream(outFile).getChannel();
     in.transferTo(0, in.size(), out);
     } finally { 
     if (in != null)
     in.close();
     if (out != null)
     out.close();
Thanks
Sumit

Thanks for all your help.I got the solution.
package com.sumit.collections;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class DotDoneFile {
     public static void main(String[] args) throws IOException {
          DotDoneFile fm=new DotDoneFile();
          fm.copyFiles1();
     public void copyFiles1() throws IOException { 
          List<String> filnamne = new ArrayList();
          File destDir = new File("C://Barcklays-soft//test2");
          File srcDir = new File("C://Barcklays-soft//test");
          File[] listOfFiles = srcDir.listFiles();
     try{
     for (int i=0;i<listOfFiles.length;i++){
          if (listOfFiles.isFile())
          filnamne.add(listOfFiles[i].getName());
          System.out.println(listOfFiles[i].getName());
          File.createTempFile(listOfFiles[i].getName(), ".done", destDir);
     catch(IOException ioe)
     System.out.println("Exception creating temporary file : " + ioe);

Similar Messages

  • Oracle SQL Developer  error - "The file-based source procedure Name is not present in the database."

    I recently started working on the Oracle SQL developer. I have 'select' privileges on the QA schema and when tried to execute proc in QA. It is giving the error as 'The file-based source <procedure Name>  is not present in the database.  Was it compiled?'
    instead 'you do not have sufficient privileges to execute this procedure'. Did research on internet but with no luck.What configuration changes needed to be done to make it work.Guide me.

    Sounds like you do not have the correct privileges.  What should have been granted to you by the QA user, or some other user with appropriate privileges, is...
    grant EXECUTE on "QA"."<PROCEDURE_OF_INTEREST>" to "<YOUR_USERID>" ;
    Note that a grant of execute on a procedure has nothing to do with grants of select on some or all of QA's tables and views.
    So, as Vadim suggests, from your connection node in SQL Developer's Connections view, if you expand the Other Users node, then expand QA and look in the Procedures node, do you see the procedure of interest?  If not, you cannot expect to be able to execute it from your userid's connection. And even if you do see it, you may have some other privilege that permits viewing but not executing, like...
    The role SELECT_CATALOG_ROLE
    The system privilege SELECT ANY DICTIONARY
    And even if you do not see it there, then having certain other privileges granted to you could permit executing it in general, like...
    The role EXECUTE_CATALOG_ROLE
    The system privilege EXECUTE ANY PROCEDURE
    Also, note that the 3.0 release is a bit dated nowadays. Upgrading to 4.0.3 production or even the 4.1 EA2 (early adopter) release will, in general, give you a better experience.
    Best wishes,
    Gary

  • I'm trying to clean up my mailbox and when I delete an item(s) I get a message that say's "operation could not be completed- file exists. Further, when I do this one message is copied (not deleted) to the trash folder. Can someone help me through this?

    I'm trying to clean my mailbox and when I click on delete or highlight and move to trash I get a message that says "operation could not be completed - file exists. Further, when I select a message or group of messages, one of them is copied (not deleted) to the trash folder. Can someone help me through this?
    Thanks.

    It's a POP account. I decided to clean up my mailbox today after noticing the computer was real slow after USA Today started sending their daily top stories with new graphics. Also before I noticed the problem with mail deletion - two things happened. 1) I updated security sofware as prompted by Apple and 2) downloaded Mackeeper and went throught some preliminary scans but did not buy their package. Thanks forn nstaying with me.

  • The file name is not valid. The file name is a device or contains invalid characters.

    Hi ,
    I am getting below error in SSIS 2008 package when it is run through control-m
    The file name is not valid. The file name is a device or contains invalid characters.
    component "FF_SRC_InboundFidelityInputFile" (1) failed the pre-execute phase and returned error code 0xC020207E.
    although this package is working fine in dev environment from visual studio.
    control-m agent has proper permissions to the folder still it is failing. Please if anyone knows solution for this issue. I am working on this issue since more than a week but reached nowhere. Please help.
    Thanks 
    Paras Gupta

    Hi Paras,
    Based on your description, it is not the VS IDE issue, if it is related to the SSIS, I suggest you post the issue in this forum here:http://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?forum=sqlintegrationservices
    , and there you would get better response.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Text inside the portlet is cutting off

    I have a process portlets and the text inside the portlet is cutting off. For example, instead of displaying the name of the process "Certificate of good standing" I get "Certificate of Goo..." How can I make the text wrap or show the full project name. I try placing the portlet in a full page, but it's still dose not fix it. Anyone know where it can be change?

    Here is the solution that I got from puspendu
    And it worked:
    From your question , I am assuming you are using the ALIP version of the BPM. The portlets UI are designed to only display that many characters for the application name and display the full name as html title field.
    If you really want to change you can go to the application.jsff file under ptjsp folder and change to display the applicaiton.name instead of applicaiton.shortname.
    ----------------

  • The name '' does not exist in the current context

    I have a recurring problem where all of a sudden I can no longer see the values of my variables when I debug my unit tests. I cannot find a pattern as to when this happens but I experience this across one of every 20 tests that I write. Occasionally this
    has also happened during normal debbuging of running code on my machine. 
    I have included 2 screen shots. The first is when it is working. I have a break point set at the declaration of list of types. At this point all my variables are still reporting their values back to the debugger. Once I step over this to the next line (screen
    shot 2) I get the error message 'The name '[variable name]' does not exist in the current context'
    This problem is annoying me to no end. If anyone has any insight as to why this might be happening I would be very much appreciative.
    My Settings/Configuration
    Using Visual Studio 2013 Premium (Version 12.0.31101.00 Update 4)
    Projects are all set to Target Framework = .NET 4.5.1
    Resharper 9.1 is installed
    My active configuration is debug mode, Any CPU
    My PC is 64bit and so is the O/S windows 8.1
    All of my projects are also compiled and built in debug mode
    For all my projects configuration debug has the Optimize Code check box unchecked
    I am unit testing code in an outside project referenced by the unit testing project (standard unit test project setup)
    I make use of the latest version of NSubstitute in my tests although I do not think that would have any bearing on this issue
    I omitted the code following the error because it is not relevant. I had cut it out and replaced it with a Task.Delay(4) which resulted in the same issue. 
    What I have tried so far
    I have tried debugging the unit test  from Visual Studio Test Explorer instead of from Resharper with the same result.
    If I remove 2 items at the end of the array it starts to work again (so 6 items initialized instead of 8)
    I clean solution with rebuild has no effect
    Removing properties of the array also seems to work, example remove all initialization of property Value
    Mark as answer or vote as helpful if you find it useful | Igor

    Hi IWolbers,
    >>I have a recurring problem where all of a sudden I can no longer see the values of my variables when I debug my unit tests. I cannot find a pattern as to when this happens but I experience this across one of every 20 tests that I write. Occasionally
    this has also happened during normal debbuging of running code on my machine.
    So you mean that it worked well before, am I right? 
    If you debug the same app in other VS machine, does it work well? So we could make sure that whether it is related to the VS IDE.
    Please disable all add-ins in your VS IDE, and then reset your VS settings, debug it again.
    https://msdn.microsoft.com/en-us/library/ms247075(v=vs.100).aspx
    Or you could run your VS in safe mode, debug it again, at least, we could know that whether it is the add-in's issue.
    https://msdn.microsoft.com/en-us/library/ms241278.aspx
    To make sure that it is not the project files' issue, create a new blank solution, copy the project files to the new solution, clean and rebuild the solution, check the result.
    >>Once I step over this to the next line (screen shot 2) I get the error message 'The name '[variable name]' does not exist in the current context'
    How about debugging it with "Step Into" instead of "Step Over"? Or you could add breakpoints between 234 line to 241 line, after the breakpoint is hit, check the watch window again. How about the result?
    In addition, do you check other debugger window like local or others?
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • The portlet name is not displayed in the portlet drop down list ?

    Hi,
    I use Sun Java System Portal Server 6 2005Q4 for windows 2000 server , use the following command to deployo portlet,
    I am not sure if I successfully deploy the portlet?
    pdeploy deploy -u amAdmin -w amadmin -p amadmin -d "cn=amldapuser,ou=DSAME Users,dc=icheng,dc=com" C:\Sun\PortalServer\tmp\portlet\portletsamples.war
    The message I got after execute the pdeploy command is =>
    Deploys the portlet war file and inserts the provider into display profile..
    OPTIONS
    --help Help message (false)
    -u --runasdn UID Bind DN (none)
    -w --password Password (none)
    -p --wc_password Password for WebContainer's Admin (none)
    -i --instance WebContainer's Instance into which the war file is to be deploye
    d (*)
    -d --dn LDAP DN of the target node (*)
    -g --global Global display profile (false)
    -r --rolesfile File containing the DSAME and portlet role mapping (*)
    -f --userinfofile File containing the user info mapping (*)
    -v --verbose Generate debug messages (false)
    -V --version Generate version information (false)
    -l --locale Locale information (en_US)
    OPERAND
    Specifies a path to the war location.
    Deploying to IWS
    Is this mean that successfully deploy the portlet ?
    After I deploy the portlet, I login to Access Manager, select the "service" from view, click the portal desktop,
    click "Manage Channels and Containers", click the "New Portlet Channel...", then click the portlet drop down list,
    the portlet name is not displayed in the portlet list.
    How can I make the portlet name displayed in the portlet drop down list ?
    Can someone help me ?
    Thanks!

    Hi
    According to your description, since this is SQL Server forum, as Olaf Helper’s post, could you get the correct result if you execute the following query in SQL Server Manager Studio (SSMS)?
    select UserName from aspnet_Users where UserId in(select FreindId from myFreinds where UserId in(select UserId from aspnet_Users where UserName = '<your typed name>'))
    If you cannot get the correct result in SSMS, I recommend to check the Transact-SQL statement. Apart from the error message, we also need to know the table structure, data, join relationships between tables for further analysis.
    However if there is no problem in SQL Server query, it will be an issue that regards ASP.NET and website deployment. I suggest you to post the question in the ASP.NET forums at
    http://forums.asp.net/ . It is appropriate and more experts will assist you.
    In addition, there is detail about listbox control in asp.net. You can review the following links:
    How to Bind/Load/Fill ListBox with Sql Server Database in asp.net:http://www.webcodeexpert.com/2013/07/how-to-bindloadfill-listbox-with-sql.html#.U5f75_6KCM9
    How to get multiple selected value in ListBox control - ASP.NET using C#:
    http://www.dotnetfox.com/articles/how-to-get-multiple-selected-value-in-listbox-control-Asp-Net-using-C-Sharp-1047.aspx
    Thanks
    Lydia Zhang

  • This field name is not known. on the server

    I have an issue using RPT file to generate a report using my .NET web app on the server, locally the report is generated fine, but on the server it's giving me the error "The field name is not known":
    [COMException (0x80041019): This field name is not known.
    Details: errorKind
    Error in File FormListAddons {74708A80-A1B6-494F-A141-C83C61F45047}.rpt:
    Error in formula Object_Visibility:
    '{visa_clients.addon1} = ""'
    This field name is not known.
    Details: errorKind]
      CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext) +0
      CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext) +362
    [FormulaException: This field name is not known.
    Details: errorKind
    Error in File FormListAddons {74708A80-A1B6-494F-A141-C83C61F45047}.rpt:
    Error in formula Object_Visibility:
    '{visa_clients.addon1} = ""'
    This field name is not known.
    The line mentioned above causing the error, is a script on crystal report to suppress the field if this condition is met:
    {visa_clients.addon1} = ""
    My PC is running Crystal Report version 11, however the Crystal Report runtime on the server running the version 10.5.1.0
    Both locally and on the server, i'm using the same datasource. Even locally i'm connecting the database on the Server.
    I would appreciate your help.

    It seems i'm posting in the wrong forum, please guide where can I post this question, to find someone who could have experience with Visual Studio and Crystal Report.
    I have 3 RPT files on my project, 2 generated successfully, only one is failing, because i'm using a script on the RPT file to suppress a field if the value is null or empty.
    So the statement of Crystal Report version 11.x not working with SQL Server 2012 is totally out of the subject.
    here is my code, for someone who knows how to read it:
    CrystalDecisions.CrystalReports.Engine.ReportDocument rpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
    System.IO.DirectoryInfo TemplatesPath = new System.IO.DirectoryInfo(System.Web.Hosting.HostingEnvironment.MapPath("~/rptTemplates"));
    string templateFile = TemplatesPath + "/" + "FormListAddons.rpt";
    rpt.Load(templateFile);
    var table = dbmgr.listClients(in_group_id);
    rpt.SetDataSource(table);
    System.IO.DirectoryInfo FilePath = new System.IO.DirectoryInfo(System.Web.Hosting.HostingEnvironment.MapPath("~/UserGeneratedReports"));
    string FileName = "FormList_" + in_group_id.ToString() + ".pdf";
    if (System.IO.File.Exists(FilePath + "/" + FileName))
    System.IO.File.Delete(FilePath + "/" + FileName);
    rpt.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, FilePath + "/" + FileName);
    rpt.Dispose();
    rpt.Close();

  • Problem in displaying text inside the item label - JFREECHART

    Hi All,
    I dont know whether this is the right place or not to post the queries related to jfreechart here .
    I am facing a problem in displaying the text inside the item label in jfreeChart. I am trying to print the text in 2 lines one below the other at the top of each bar in waterfall chart.
    Please find the code below in next post. The problem i am facing is it is neglecting the new line character . If any one knows how to display the text one below the other please help me out .
    Thanks in advance .
    Regards,
    Diw

    i am facing the problem in pasting the complete code as its exceeds the message text limitiation, please find the link below for the code .
    http://www.java-forums.org/java-2d/12087-problem-displaying-text-inside-item-label-jfreechart.html#post36648
    Early response will be appreciated . Thanks in advance
    Regards,
    Diw
    Edited by: Diw on Sep 30, 2008 11:15 AM
    Edited by: Diw on Sep 30, 2008 11:16 AM

  • May I know how to change the color of texts inside the indicator box?

    Can anyone tell me how to change the color of texts inside the indicator box? I have tried to use property node but not really know how it functions.
    In fact, I am writing a program for which the number inside indicator on front panel will show red color if the measured value can't reach the requirement. I am using LabView 6.1 Professional
    Thank You for your attention!!!!!!

    Simply use a property node with "NumText.TextColor" and wire the correct color depending on your test result.
    The attached simple example (LV 6.1) lets you change it from the front panel. In your case, you would use your test output instead of a FP switch, of course. Message Edited by altenbach on 05-25-2005 09:05 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    TextColor.vi ‏18 KB

  • Last Approver name in not appearing in the shopping basket

    Hi  SRM Gurus,
    We have Implemented N step Badi for our client .During Post Go Live we are facing this issue
    We have created a shopping basket and there are 3 approvers to approve. After the first approvers is approved the name is not appearing in the Shopping basket.
    We are in SRM 4.0
    Can you tell what could be the reasons
    G.Ganesh Kumar

    Hi Ganesh,
              How you fixed your problem ?  Actually i am facing same problem for Bid invitation.
    Regards
    Abhijeet

  • I'm using Firefox w/ Yahoo Mail on a Mac. When I try to copy/paste text in the body of the emai, it thinks I'm inserting a picture & all kinds of little text boxes appear. What can I do to get rid of all the little text boxes?

    This always happens when I try to copy/paste text into the body of my yahoo email. It only started happening when i switched to a mac.

    Try this extension:
    *Extended Copy Menu (fix version): https://addons.mozilla.org/firefox/addon/extended-copy-menu-fix-vers

  • This procedure name is not found in the database: wwv_flow.show

    I created an interactive report, which works fine in the APEX developer, using the Application Express Authentication scheme.
    To add it to our Self-Service web system, I change the authentication scheme to a custom scheme that has been working fine for other applications, although I don't know of any other interactive reports using this scheme in Self-Service.
    Anyway, the interactive report is displayed in our Self-Service system using the custom authentication scheme, but if I display the Action menu and click on one of the options (Filter, Sort, Compute...), a pop-up window is displayed saying:
    This procedure name is not found in the database:
    wwv_flow.show
    That error is also displayed when I try to edit the displayed filters.
    Does anyone know why I might be getting that error or have suggestions on things to try to track it down?
    Thanks,
    Laura

    Laura,
    To add it to our Self-Service web systemWhat does that mean? What did it entail?
    I'm thinking maybe you embedded some relative links into a menu system in which the base href was not appropriate, ... or something.
    Scott

  • Cause is mentioned as : "The cause for this error is due to person name is not assigned to the FND_USER."

    Cause is mentioned as : "The cause for this error is due to person name is not assigned to the FND_USER."
    Do we need to attach the person name of employee whose reverse Global deployment we are doing or the person name of the person who is doing this transaction.
    Thanks & Regards,
    Kirti Mohan Sharma

    You just need to attach the person to the FND User. System Administrator responsibility - Security - User screen.
    After you have linked the person, you can check the table
    Select * from FND_USER
    Where user_name = '<user_name>';
    Cheers,
    Vignesh

  • CalDAV Server: Access to account "NAME" is not permitted.  The server responded: "403" to operation CalDAVRemoveCalendarQueueableOperation.

    I am running SL Server 10.6.8 and have a problem with only one iCal server account (mine).  I am unable to delete a calendar that I created. I can rename it (was called "Home" and changed it to "Delete Me"). I can create new calendars and have one called "Home" and another called "Work" which I can also rename and delete without any problem.  However, when I try to delete my original "Home" calendar, now called "Delete Me" it warns me that I will loose any appointments so I know iCal thinks there are events in the calendar otherwise it would not give that prompt. However, when I go to the year view and scan forward and back approx 20 years there are no events to be seen. I then confirm that I want to delete the account and then I get the following error with the option to "Ignore" or "Go Off-line"...
    Access to account “NAME” is not permitted.
    The server responded: “403” to operation CalDAVRemoveCalendarQueueableOperation.
    If I ignore the calendar simply reapears and if I go off-line my calendar stops syncing and remains off-line until I try to take it back on-line at which time I get the above error again.
    Any ideas how to fix this?  I think it is because of this calendar I am unable to access my calendar via web as well. All other accounts on the server are able to but mine but going to eat this elephant one bite at a time and then resolve the ical web access afterwards.
    Any help is greatly appreciated.  Thank you.

    Found solution!!!!
    After trying to delete the calendar "family" multiple times and reading through some threads... I was able to figure out that the "Family" calendar that we can't seem to delete is corrected to FAMILY SHARING.  Here is what I did:
    Went on my iPhone 5S
    1.Go to Settings
    2. Scroll down to iCloud; and click on it
    3.Click on "Family"
    4. Click on your name at the top (has to be the organizer, i think)- I was the organizer so it worked
    5.Stop Family Sharing
    6. Stop Sharing
    Now you can go to your calendar app and delete it! here is how in case you don't know
    1. Click on Calendar app
    2. Click on the word "Calendars" in middle of screen
    3.Click on "Edit" at top left hand corner of screen
    4. Scroll down to the calendar you want to delete and click on it
    5. Scroll to the bottom of the screen and click "delete calendar"
    DONE!!
    If you  are using your calendar on a mac like I was.... hence why it took sometime to figure this out.  You have to stop family sharing from iPhone (if you can do it on the mac- more power to you, I didn't try figuring that out) and then you can go on your mac (if your connect to WI-Fi):
    right click the calendar you want to delete,
    select delete and it should go away!
    yay!! hope this helps!!

Maybe you are looking for

  • Error in MSS requisition 'No personnel number is assigned to your user in SAP E-recruiting '

    Hi , We are getting error in MSS requisition in E recruiting system that 'No personnel number is assigned to your user in SAP E-recruiting ' while clicking on next button in the requisition form.We have assigned all specified roles for the E-rec rela

  • IWeb password not working

    I have made some changes to my website in iWeb, but when I try to publish it, and enter my password, it is not taking it. It has been a long time since I've made any changes. What am I missing here? Thanks.

  • Adding Keywords to old pics

    If I import old folders of say a certain vacation and add keywords, how to do I get the keywords attached to the old pictures.  I can understand how it works when I moving pics from the camera to the PC via LR where I import save and add keywords all

  • How many GBs are free in a 17" CD2 160HD when you buy it?

    A 160Hd comes formatted and with the OS X installed... I'd like to know how many GBs are free to put your things there. I guess it's maybe something like 120GB? Thank you!

  • What is the latest Safari revision for Mac OSX 10.4.11

    I have a vintage Mac G3 B/W Desktop PPC, which still operates perfectly.  But, at times Safari 4.1.3. periodically crashes.  Is there a later revision that I can upgrade to?  Software Update says the computer is up to date.