Any help to let me know how to manipulate files with java !

hi!
i ma interesting in making an application that allow me to manipulate files end directories, i mean copying, deleting, renaming,and so on ...
so please if anyone can grant me some help ( titorials, code samples,..) it will be very apreciated.
thanks.

import java.io.*;
public class FileFun {
public static void main(String args[]) throws Exception {
  File f = new File("yep.txt");
  f.createNewFile();
  FileOutputStream fos = new FileOutputStream(f);
  fos.write("hello from java!".getBytes("UTF-8"));
  fos.write("bye from java!".getBytes("UTF-8"));
  fos.close();
}Look at the API for "File, FileInputStream, FileOutputStream" .. they should get you what you want.

Similar Messages

  • Can any one pls let me know how to set up budget in HRMS ..

    Hi Gurus,
    Can any one pls let me know, how to setup Budget in HRMS ..
    with regards
    user600722

    Hi,
    Thank you for the Valuable Information Sir ....
    with Regards
    User600722

  • HT4061 I lost my Iphone and I need IMEI number, but I have only serial number. Can I get IMEI number through Iphone serial number ? if possible please help and let me know how

    I lost my Iphone and I need IMEI number, but I have only serial number. Can I get IMEI number through Iphone serial number ? if possible please help and let me know how

    If you go to the computer where your sync your phone to and open itunes and then go to edit in the tool bar then preferences then device preferences then devices.. hover the mouse pointer over your device name in the back up lists that appear there and it shows the IMEI

  • Do you know how to call RDF with java code?

    Say me a tip!
    Environment:
    Linux, Reports 6i,java beans, jsp
    My mission is to run a report with java code.
    But I don't know how to.
    Basic flow is :
    On web browser, call jsp a program and
    that jsp call a java module,
    and the java module call a reports RDF with parameters
    I don't need reponse message from rwcgi60 or rwrun60.

    hello,
    the easiest way is to use the regular HTTP request to either the servlet or the CGI to run a report request from within a java-class.
    regards,
    the oracle reports team --pw                                                                                                                                                                                                                                                                                                                                                                                       

  • Help! Need to know how to swap depths with Action Script 3

    So i have several movie clips all on one layer.  Its an interactive gallery where when a photo is selected it plays the movie clip and the photo grows to fill the screne.  The problem is, since the animations take part within the movie clips and all the movie clips exist on the same layer when they are selected and grow to fill the screne they are being hidden behind all the movieclips infront of it in that layer.  I know that there is an action to bring movieclips to the highestdepth or to front on click/release but i do not have a clue where to start. But I am working in actionscript 3.0
    If it will help we can post a link to the flash file.
    Thanks!

    I would probably use setChildIndex like
    container.setChildIndex(clickedOnClip, container.numChildren - 1);
    you could make a more general bring to front as well:
    function bringToFront(obj:DisplayObject):void
        obj.parent.setChildIndex(obj, obj.parent.numChildren - 1);

  • How to compare files with Java - help me!

    Is there any free utilities?

    www.google.com and www.sourceforge.net would be good places to start. You can locate these using a 'browser'.
    - Saish

  • How import policy file with Java Web Start

    hi everybody,
    I wrote an application launched by Java Web Start.
    This application encrypt data on the client side and POST them to the server.
    To encrypt I use JCE packages including sunjce_provider.jar, jce1_2_1.jar and
    local_policy.jar and US_export_policy.jar.
    local_policy.jar and US_export_policy.jar are not packages, each of them contains
    a policy file.
    When I test encryption on local no problem, but when I test with Java Web Start
    I've got this exception :
    java.lang.ExceptionInInitializerError:
    java.lang.SecurityException: Cannot set up certs for trusted CAs
    It's because the application launched by Java Web Start doesn't find local_policy.jar
    and US_export_policy.jar.
    There's a problem in my JNLP file :
    <jnlp spec="1.0+" href="http://myserver/sources/test.jnlp" codebase="http://myserver/sources">
         <information>
              <title>Java Web Start TEST</title>
              <vendor>NLE Intech</vendor>
              <description>cryptage then upload</description>
         </information>
         <security>
              <all-permissions/>
         </security>
         <resources>
              <j2se version="1.3" />
              <jar href="sunjce_provider.jar" />
              <jar href="jce1_2_1.jar" />
              <jar href="local_policy.jar" />
              <jar href="US_export_policy.jar" />
         </resources>
         <application-desc main-class="HelloWorldSwing" >
              <argument>c:\myfiletoencrypt</argument>
         </application-desc>
    </jnlp>
    thank you for your answer

    Hi Nicolas,
    If you migrate to JDK1.4 and use the signed Bouncy JAR, you could resolve the problem,
    if you don't want to use unlimited cryptography.
    See my posting on your other question.
    Agnes
    PS. There is a mistake in my other reply, the "local_policy.jar" and the other files must have
    to go into JRE/LIB/SECURITY directory

  • How to create file with APDU

    Hello everybody,
    It's my first time using Java Card ^_^,I want to create a file and fill the fill with binary data.but i don't know how to create file with APDU commands,so I need help here.
    I think that there must be a Manual of the JavaCard's OS in this world,can someone tell me where to download it??
    Thanks.
    the fllowing is my card:
    Samsung S1
    Model:TiEx-32J
    EEPROM size:32k
    Platform Version:OP 2.0.1
    Card Manager Status:OP_READY
    KMC:40~4F/No derivation
    Message was edited by:
    AllenHuang

    If you look around the forum for a bit, you will see that there is no notion of file systems on JavaCards (lexdabear posted this information less than two hours ago :-)). To store files, you will have to write an applet to hold byte arrays of the required size and handle receiving and sending of these.
    As for documentation, you should have a look at the GP (General Platform) specification at http://www.globalplatform.org/, which defines communication between smart cards and other devices, as well as Sun's own JavaCard pages (http://java.sun.com/products/javacard/), which contain several useful resources on JavaCards.
    Message was edited by:
    Lillesand

  • Help needed I updated my ipad2 with iOS5 but few of my dashbaords are not working now can any one let me know how to downgrade the OS

    Help needed I updated my ipad2 with iOS5 but few of my dashbaords (HTML5) are not working now ,can any one let me know how to downgrade the OS as we have a meeting coming up .. its urgent

    Downgrading the iOS is not supported. If you are using Safari this try clearing its cache via Settings > Safari.
    If that doesn't work then try closing Safari completely and then re-open it : from the home screen (i.e. not with Safari 'open' on-screen) double-click the home button to bring up the taskbar, then press and hold any of the apps on the taskbar for a couple of seconds or so until they start shaking, then press the '-' in the top left of the Safari app to close it, and touch any part of the screen above the taskbar so as to stop the shaking and close the taskbar.
    A third option is a reset : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.

  • I dont know how i got my photos to my ipod touch from my pc and now i wanna delete them but couldn't. so need help. please let me know.

    i dont know how i got my photos to my ipod touch from my pc and now i wanna delete them but couldn't. so need help. please let me know.

    To turn off auto sync - launch iTunes and go to Edit>Preferences>Devices - check the box at the bottom that says - Prevent iPod, iPhones and iPads from syncing automatically. Click OK and then quit iTunes.
    Connect your iDevice to your PC.
    Launch iTunes,
    Click on the device name on the left side of the iTunes Window.
    Click on the Photos Tab in the iTunes window on the right.
    Untick all of the photos or albums that you want to remove.
    Click on Apply in the lower right corner of iTunes
    If you untick or uncheck the Sync Photos heading and then click Apply it will remove all of the photos from the device when it syncs. In this screenshot - I have only certain albums and events selected to sync.

  • Every time I right-click an image in Firefox 3.6.12 to view image size info it says "Unknown (not cached)". Any ideas on why this could be happening and how I can stop it? My OS is Ubuntu 10.10. If you need any more info let me know.

    Every time I right-click an image in Firefox 3.6.12 to view image size info it says "Unknown (not cached)". Any ideas on why this could be happening and how I can stop it? My OS is Ubuntu 10.10. If you need any more info let me know.

    Is the disk cache and the memory cache enabled?
    You can check these prefs on the about:config page.
    * http://kb.mozillazine.org/browser.cache.disk.enable
    * http://kb.mozillazine.org/browser.cache.memory.enable
    To open the <i>about:config</i> page, type <b>about:config</b> in the location (address) bar and press the "<i>Enter</i>" key, just like you type the url of a website to open a website.<br />
    If you see a warning then you can confirm that you want to access that page.<br />
    Your More system details list shows two outdated Flash plugins that you should remove and update to Flash 10.1 r102 or at least remove 10.0 r45 and wait until your distribution offers a 10.1 r102 update.
    # Shockwave Flash 10.0 r45
    # Shockwave Flash 10.1 r85
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/

  • I downloaded a cheap PDF editor and it converted all my PDFs to their software. Then when I deleted it, I cannot open them in the Adobe format any longer. Please let me know how to get them back!

    I downloaded a cheap PDF editor and it converted all my PDFs to their software. Then when I deleted it, I cannot open them in the Adobe format any longer. Please let me know how to get them back!

    It's important to understand that when this sort of thing happens files aren't "converted" at all.
    In Windows and Mac, there is just one app (program) that it run when you double click a type of file. There's an app for Word documents (Microsoft Word). There's an app for PDF files. So all that happened is that you installed an app which can open PDF files.
    Nothing changed in the files. You can still open them the traditional way if you forget double click - start the app, use Open from the File menu.

  • Can any one let me know how to  find out current internet explorer version

    Can any one let me know how to find out current internet explorer version

    Don;t use annoyed repeated words. Try to explain exactly what is your problem.
    <script LANGUAGE="JavaScript">
    document.write("Your browser Name: <B>" + navigator.appName + "</B>.<br>")
    //Detect IE Version Only
    if (navigator.appVersion.indexOf("MSIE")!=-1){
    var temp=navigator.appVersion.split("MSIE")
    var version=parseFloat(temp[1])
    document.write(" Your Browser version: <B>" + version + "</B>.")
    </script>

  • I am facing troubles as Firebug is not compatible with this version, I dont want to use any older version. please let me know how to fix this or if you have any other workaround.

    I am facing a lot of troubles as Firebug and my other add-ons are not compatible with the new releases of firefox.
    I don't want to switch to any other older version of firefox...
    Please let me know how to fix this.. or I request you to provide a solution / work around ASAP.
    Thanks...

    Firebug has development versions that should work in Firefox 4 beta builds. Try the latest version (1.6X.ob1) available from http://getfirebug.com/releases/firebug/1.6X/
    This is a beta version of Firebug.
    For other add-ons marked as incompatible, you can install the [https://addons.mozilla.org/en-US/firefox/addon/15003 Add-on Compatibility Reporter], this will enable all of your add-ons and you can test to see if they work. If the add-ons do not work you can disable them. Note that the current release version of Firebug will not work, you will need to use the beta version.

  • HT1766 Dear Friends,Hi! please help me and let me know how to down load youtube video to my IPhone 4s

    Dear Friends,Hi!
    let me know how to download youtube video in my Iphone4s
    thanks
    Regards

    "ProTuber" app from App Store

Maybe you are looking for

  • How do I find out the size of my iTunes library in iTunes 11?

    Need to find out so I can deem which model of iPhone 5 is suitable when I upgrade at the weekend, but the info bar at the bottom of the window has disappeared and quite frankly, I'm clueless. UPDATE: Found the answer.

  • Itunes freezing with Ipod Touch on Windows 7x64 when setting up

    Hi, I have an Ipod Touch 3G and a new Dell XPS16 Core I7 with Windows 7 x64. The Ipod cannot be Synced or restored properly. When connecting it it says there is an issue with the Ipod and it needs to be restored. The actul restore seems to go OK but

  • DbAdapter invocation issue

    Hello everyone, I have a stored procedure in a SqlServer 2012 database, as follows: CREATE PROCEDURE [dbo].[SP_GET_PERSONS] @Id varchar(15), @FirstName varchar(30), @LastName varchar(30) WITH EXEC AS CALLER AS BEGIN      Declare @SQL VarChar(MAX)   C

  • Problems with Candidate Selection

    Hi experts, I'd like some help about something I'll have to do here in my current customer. Today, when the recruiter wants to select an internal canidate he/she can select the internal candidates who applied for a job and can see a CV with some info

  • Photo stream and snow leopard

    Can I use Photo Stream with Snow Leopard and a 5 gen iPod Touch?