UI command to delete file.

hi,
i want to have a command for deleting a file .. it should be a button beside every resource which is being displayed in the KM folder (/documents/kumar).
i have seen https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/kmc/Knowledge%20Management%20and%20Collaboration%20Developers%20Guide.html >> COMMANDS and tried the URL redirect thing..
i have created a UI COmmand in KM and included that in the DetailsGroup_test (which i included in my layoutset_test for a navigation iView) but i don't see it..
code is as follows (same as given in the above link):
public class MyUICommand extends AbstractCommand {
      * redirecting to a URL
     public MyUICommand() {
          super("myButtonTextKey", "myTooltipTextKey");
     public ICommand getNewInstance() {
          return this.initNewInstance(new MyUICommand());
     public IRenderingEvent execute(IScreenflowData arg0) throws WcmException {
          return null;
     public String[] getTargetParameters() throws WcmException {
          return new String[0];
     public void setTargetParameters(List list, IResourceContext context)
          throws WcmException {
     public boolean isExecutable() {
          return true;
     /*** Prevents an event being fired.* The execute method will not be called.*/
     public boolean raisesEvent() {
          return false;
     /*** Causes a redirect to the specified URL* in the specified target frame.*/
     public LinkAttributes getLinkAttributes() {
          return new LinkAttributes("http://www.sap.com", "_blank");
i have also duplicated 'Commands for details menu' in Layoutset >>> MyGroup_new >> MyUICommand_alias
plz help. points assured
regards
kumar.

i tried to use the SDN example:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/implementing flexible ui one-step-screenflow.article
and i am getting ClassCastException:
[code] Please wait
Your request is being processed
System Error
An exception occurred during the program execution. Below you will find technical information pertaining to this exception that you might want to forward to your system administrator.
Exception Class: 
Call Stack java.lang.ClassCastException
        at com.sapportals.wcm.control.generic.WcmErrorControl.readInputData(WcmErrorControl.java:553)
        at com.sapportals.wdf.stack.Control.triggerInput(Control.java:473)
        at com.sapportals.wdf.WdfEventDispatcher.dispatch(WdfEventDispatcher.java:173)
        at com.sapportals.wdf.WdfCompositeController.onWdfEvent(WdfCompositeController.java:539)
        at sun.reflect.GeneratedMethodAccessor563.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at com.sapportals.htmlb.page.DynPage.doProcessCompositeEvent(DynPage.java:204)
        at com.sapportals.htmlb.page.DynPage.doProcessCurrentEvent(DynPage.java:142)
        at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:115)
        at com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:134)
        at com.sapportals.wcm.portal.component.base.ControllerComponent.doContent(ControllerComponent.java:73)
        at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
        at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
        at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
        at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
        at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
        at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)
        at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:646)
        at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
        at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
        at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
        at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)
        at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)
        at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:522)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:405)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
        at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
        at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
        at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
        at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
        at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
        at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
        at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
        at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
        at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
        at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
        at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)[/code]        
i added the lines-of-code which are in BOLD below
[code]
public IRenderingEvent execute(IResource res, Event event) throws WcmException {
          if (event instanceof ConfirmEvent) {
               ConfirmEvent cce = (ConfirmEvent)event;
               if (ConfirmEvent.CHOICE_YES.equals(cce.getChoice())) {
<b>                    // do the action here ...
                    if(resource != null){
                           resource.delete();
                    } else {
                           return new RenderingEvent(
                           new CflStatusInfoEvent(StatusType.ERROR, "Resource null!"));
                    }</b>
               return new InfoEvent(Status.OK, "Done !");
               }     else if (ConfirmEvent.CHOICE_NO.equals(cce.getChoice())) {
                    return ConfirmComponent.onNo(event, res.getContext().getLocale());
               } else if (ConfirmEvent.CHOICE_CANCEL.equals(cce.getChoice())) {
                    return ConfirmComponent.onCancel(event, res.getContext().getLocale());
          return new InfoEvent(Status.ABORT, "Aborted.");
[/code]
plz help..
i am getting the menu in Details screen .. but, i should get the command in the KM folder beside every resource/file. .. how should i change it ..
regards.

Similar Messages

  • Unix command to delete files with .cache extension

    I was wondering if anyone knew of a unix command that can be sent to another computer that will delete all files on the hard drive with a certain extension such as .cache.
    Like: rm *.cache
    Thank you!

    Well, I don't recommend it, but if you want to fubar the computer, send this as root:
    find / -name "*.cache" -exec rm -f {} \;

  • Unable to delete files from encrypted external SD Card using File Commander

    I've run into some trouble trying to delete the directory com.spotify.music from my external SD Card (encrypted) after a hard reboot using the reset button next to the sim card.
    I need to do this for the Spotify app to work (FC on starting it) and I'm currently unable to delete the folder and its contents from Sony provided file explorer(FC File Commander).
    Is there a way to delete this app from adb or other command line tool or how should I go about this? Developer options are enabled because I'm learning to develop apps. Not particularly keen on rooting or otherwise format my SD Card but it's an option if there are no other ways to do it. 
    I can see the contents of my card using File Commander just fine. Spotify app is uninstalled, I tried remove cache and data before uninstall also.

    Thommo wrote:
    Are you able to delete files via your Pc or are you able to remove the card from your phone and connect it to a Pc for file deletion - There is a free program called Unlocker currently on version 1.9.2 which is excellent at deleting files that don't want to be deleted - You would install the program then right click the file and choose Unlocker and then when the program starts choose delete
    I guess he will not be able to move the SD card to the computer since it's encrypted and is working only with that particular device, but he should be able to access it via PC.
    If you can try to uninstall Spotify from your phone. I assume Spotify is not working due to some rubbish inside it's directory, but on the other hand you can't delete the folder because it may be used by Spotify. If you uninstall app folder may be unlocked.
    Best regards,
    Sergio PL
    Xperia Z1 / Nexus 7 (2012)

  • Applescript Deleted Files via "Make Folder" command

    As I was working on an app to transfer photos from my memory card to my computer, I opened a new applescript window to do some testing of the next part of it separate from the main script. I did a simplet "make folder" command to make sure I had the right path. I went to the location I set (my photos library) and one by one, my photo folders started to disappear! This is the code Applescript ran:
    tell application "Finder" to make folder in folder "Canon EOS T1i" of folder "Pictures" of folder "Steveporter" of folder "Users" of disk "Macintosh HD" of application "System Events"
    The weird part is, ONLY the folders the app made were effected. I have other photos outside of folders that were not deleted, and my iChat Icons folder is still there. I also have the ""Untitled Folder" created by the script.
    Does anybody know why in the world that one line in a script would delete my entire photos library? There were no other scripts running, the only apps were Safari and Applescript. I'd also like advice on how I can recover my photos. I downloaded the trial of MacKeeper and it is currently scanning my iMac for recoverable files. Thanks!

    I have not heard good things about WD external enclosures.  The drive are supposedly OK.  Take drive out put in another enclosure.
    Stop using the drive immediately.
    Get  an external drive.  I like OWC.
    I recommend you do a google search on any external harddrive you are looking at.
    I bought a low cost external drive enclosure. When I started having trouble with it, I did a google search and found a lot of complaints about the drive enclosure. I ended up buying a new drive enclosure. On my second go around, I decided to buy a drive enclosure with a good history of working with Macs. The chip set seems to be the key ingredient. The Oxford line of chips seems to be good. I got the Oxford 911.
    Has everything interface:
    FireWire 800/400 + USB2, + eSATA 'Quad Interface'
    save a little money interface:
    FireWire 400 + USB 2.0
    This web page lists both external harddrive types. You may need to scroll to the right to see both.
    http://eshop.macsales.com/shop/firewire/1394/USB/EliteAL/eSATA_FW800_FW400_USB
    The latest the hard drive enclosures support the newer serial ata drives. The drive and closure that I list supports only older parallel ata.
    Here is an external hd enclosure.
    http://eshop.macsales.com/item/Other%20World%20Computing/MEFW91UAL1K/
    Here is what one contributor recommended:
    http://discussions.apple.com/message.jspa?messageID=10452917#10452917
    Folks in these Mac forums recommend LaCie, OWC or G-Tech.
    Here is a list of recommended drives:
    http://discussions.apple.com/thread.jspa?messageID=5564509#5564509
    FireWire compared to USB.  You will find that FireWire 400 is faster than USB 2.0 when used for a external harddrive connection.
    http://en.wikipedia.org/wiki/Universal_Serial_Bus#USB_compared_to_FireWire
    http://www23.tomshardware.com/storageexternal.html
    Here is my list.  Your going to need another external drive to recover the data wit these utilities anyway.
    Boot in safe mode. Hold down the shift key when powering on the machine. This will run a disk repair program. Boot up will take longer as the harddrive is scanned and repaired.
    See this article:
    http://docs.info.apple.com/article.html?artnum=107393
    Or from mrtotes article :
    Boot from the OS X Install disk and from the Menu Bar choose Disk Utility. Then run "Repair Disk" and "Repair Disk Permissions" on your hard disk.
    Here the apple article on booting single user mode and using fsck. See the section on Use fsck:
    http://docs.info.apple.com/article.html?artnum=106214
    Perhaps Disk Warrior will be of some help:
    http://www.alsoft.com/DiskWarrior/
    "Stellar Phoenix Macintosh - Mac data recovery software, recovers data from damaged, deleted, or corrupted volumes and even from initialized disks."
    They have a trial version, so I guess you can see if your data can be recovered...
    http://www.stellarinfo.com/mac-data-recovery.htm
    "Data Rescue II is the best data recovery software on the market for recovering files from a problem hard drive. Data Rescue II works when other tools fail. Data Rescue II is also completely safe to use since it does not attempt any risky repairs to the drive while its scanning."
    http://www.prosofteng.com/products/data_rescue.php
    FileSalvage is an extremely powerful Macintosh application for exploring and recovering deleted files from a drive or volume.  FileSalvage is designed to restore files that have:
    -- been accidentally deleted.
    -- become unreadable due to media faults.
    -- been stored on a drive before it was re-initialized/formatted.
    http://subrosasoft.com/OSXSoftware/index.php?main_page=product_info&products_id= 1
    "TestDisk is a free data recovery utility. It was primarily designed to help recover lost data storage partitions and/or make non-booting disks bootable again when these symptoms are caused by faulty software, certain types of viruses or human error (such as accidentally erasing a partition table)."
    http://en.wikipedia.org/wiki/TestDisk
    "*Hard drive data recovery and warranty implications*
    Hard drives that have become non-functional through normal use, and have had data recovery performed on them by DriveSavers or Ontrack Data Recovery can be returned to Apple for warranty service. This includes products covered by the AppleCare Protection Plan. The cost of any data recovery attempts is not covered by the Apple Limited Warranty."
    http://support.apple.com/kb/HT3974?viewlocale=en_US
    Entering:
    mac data recovery
    into Google will list some firms who specialize in recovering data. Data recovery isn't cheap.
    Examples:
    1) Ontrack Data Recovery is the world leader in data recovery services and data recovery software offering the fastest,  most convenient and cost-effective solutions to clients who have experienced data loss.
    http://www.ontrackdatarecovery.com/
    2) Enter the world of DriveSavers Data Recovery…
        * Data Recovery Tools
        * Data Recovery Process
        * Data Recovery Cleanroom
    http://www.drivesavers.com/
    "Encryption:  DriveSavers engineers have been trained and certified by leading encryption vendors, such as GuardianEdge, Utimaco Safeguard, PGP and PointSec, to safely recover file-level and disk-level encrypted data"
    http://www.drivesavers.com/recovery-services/encryption/
    List of recovery software tried:
    http://discussions.apple.com/post!reply.jspa?messageID=11100707
    Robert

  • Pressing command-z deletes the files even if there is no restore location

    I have copied some photos from sd card to my mac. Then I deleted the files from sd card and removed it to take more photos. While my friend was taking pictures somehow accidently I pressed the command-z. Then whole folder just disappeard. I didn't even get any notification that telling me "cannot find restore location" or " files will be deleted". Folder just disappeared in 1 second. They are not in the trash also.
    Where did they go? Are they in some sort of temporary storage? How can I get them back?
    SD Card is already full with other images so recovery program couldn't bring the old files back. Recovering on the computer might take so long time since I have 500gb hard drive. Is there a fast way to get files back?

    I cannot try it now for that folder since i did other copy oparations. But I did it with another file to try. I copied file from usb drive. Then I removed my usb drive and pressed command-z. File disappeared then I pressed command+shift+Z. A notification popped up "The operation can't be completed because it isn't supported". 

  • Unable to configure Reporting Services 2012 after using 'netsh http delete urlacl' command and .EXE file also.

    One of my servers quit responding during some troubleshooting of another issue and when I try
    to reconfigure it I am receiving Results as follows:
    Reserving url http://+:80
    The URL has already been reserved.
    It appears to me that there is something with the Virtual Directory that is not allowing me to use it or
    overwrite it.  If I change the name or the port the new configuration works fine, however this is part of a scale-out test environment and I need to keep the virutal directory names the same.
    I have uninstalled and reinstalled SSRS in an attempt to resolve, but that did nothing to this issue.
    I have used 'netsh http delete  urlacl' command and deleted saved urls also but still am facing issue.
    How can I manually list, delete, or edit  Virtual Directories in SSRS 2012? 

    Hi Syed,
    Based on my research, the issue can be caused by the default values for Report Server Web Service and Report Manager has already been reserved. In order to trouble shoot this issue, please refer to the following steps:
    To check this issue, we can run the following command in the command windows:
    netsh http show urlacl | find "Report"
    It should returns the reserved URL as below:
    Reserved URL            :
    http://+:80/ReportServer/
    User:
    Reserved URL            :
    http://+:80/Reports/
    User:
    Then we can delete the reserved URLs with the command below and recreate them to fix this issue:
    netsh http delete urlacl http://+:80/ReportServer/
    netsh http delete urlacl http://+:80/Reports/
    Reference:
    http://fix.lazyjeff.com/2011/12/sql-server-2008-r2-report-server-web.html
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Delete file from an FTP folder

    Hi expert,
    I wanna know if it's possible delete with abap command a file from a FTP folder.
    I mean, there is a ftp folder periodically filled with excel files. An ABAP program read this folder and the files content must be moved in a SAP Table. Aftre this, I must delete excel files with an abap command write in the same abap program.
    Thanks a lot
    Michele Garofalo

    1) read directory with fm EPS_GET_DIRECTORY_LISTING
    2) process table dir_list
    and 3) finally delete files with
    abap command:  DELETE DATASET dsn.
    hope that helps
    Andreas

  • I am deleting files through my trash in my macbook pro (2010) and then emptying the trash can, but my hard disk space is not increasing! i recently upgraded to lion and the problem is new, wasn't the same with snow leopard! HELP!!!!!

    i am deleting files through my trash in my macbook pro (2010) and then emptying the trash can, but my hard disk space is not increasing! i recently upgraded to lion and the problem is new, wasn't the same with snow leopard! HELP!!!!!
    When i press command+I (Get Info) i see that there is 140 GB "Available Space" on my hard disk but when i click on my hard disk icon on the desktop, and then press "space" i only see 102 GB free!! What the f*???
    Please HELP!!!!!! Getting second thoughts on Lion!!!!

    Hi b,
    Have you restarted yet?

  • How to copy/delete file

    hi,
    i need to come out a program, which can copy/delete file from unix directory A to directory B, on the application server.
    does any one have any idea how am i going to code the abap program for this?
    thanks

    > i need to come out a program, which can copy/delete file from unix directory A to directory B, on the application server.
    >
    i am assuming that your Application server is Unix.
    unixcommand cp is used to copy the a file from one directory to another.
    cp /dir/file1 /dir2/file2
    the above command will copy the file1 of dir1 to file2 of dir2.
    for delete use the command rm,
    rm /dir/fiel1
    the above command will remove the file1 from directory dir.
    REPORT ZUNIX line-size 400
                    no standard page heading.
    parameters : unixcom like   rlgrap-filename.  
    data: begin of tabl occurs 500,
            line(400),
          end of tabl.
    data: lines type i.
    start-of-selection.
      refresh tabl.
      call 'SYSTEM' id 'COMMAND' field unixcom
                    id 'TAB'     field tabl[].
    "if any error or any thing you get in the tabl
    "just check the tabl once after the finishing

  • Deletion files

    hi
    i have a very strange problem, so the application is swing app, i use intellij IDEA this is only informative.It is for uploading files to ftp, at the end of the process i must delete files, the problem is that the last one file doesn't delete.The strange is that when i run the application from idea it works ok, but when i run the application from jar it can't delete the last file
    i make jar file with ant. the difference between the running application from idea and from the jar is that in idea i create instance of Login (JFrame) and it is on, from the jar there is a method that at run time execute the following command in a new thread : "java -Xms128M -Xmx512M"
    + " -cp ./;ProcessingTool.jar; + "(here is adding all libs to class path...)"
    + " dialogs.Login");
    i thought that i have not close a stream, but why then from idea it works, and from jar doesn't.
    please help!!!

    When you run from the IDE you have another layer that is helping to control things like your I/O, so the results will not always be the same as if you run natively.
    When you want to delete a file, every reference to it must be closed first.

  • Where can I find the Start up disk and how can I delete file from it.

    where can I find the Start up disk on theMac Book Air?
    How can I delete files from it?

    The startup disk is the internal SSD in your MBA.  You may delete files by draging the file  to Trash (or clicking on them and then execute COMMAND+Delete).  Then empty Trash.
    Ciao.

  • Cannot delete file ...bug?

    This appears like a bug to me...see if you agree.
    A file opened for read-only access and memory mapped using the map method of FileChannel cannot be deleted even when the channel is closed. An example of this is the simple Grep.java example from NIO modified only to try and delete the file. On Win2K, the delete fails. Once the channel is closed, it should be able to delete the file. Is this a bug?
    import java.io.*;
    import java.nio.*;
    import java.nio.channels.*;
    import java.nio.charset.*;
    import java.util.regex.*; public class Grep {     // Charset and decoder for ISO-8859-15
    private static Charset charset = Charset.forName("ISO-8859-15");
    private static CharsetDecoder decoder = charset.newDecoder(); // Pattern used to parse lines
    private static Pattern linePattern
    = Pattern.compile(".*\r?\n"); // The input pattern that we're looking for
    private static Pattern pattern; // Compile the pattern from the command line
    private static void compile(String pat) {
    try {
    pattern = Pattern.compile(pat);
    } catch (PatternSyntaxException x) {
    System.err.println(x.getMessage());
    System.exit(1);
    } // Use the linePattern to break the given CharBuffer into lines, applying
    // the input pattern to each line to see if we have a match
    private static void grep(File f, CharBuffer cb) {
    Matcher lm = linePattern.matcher(cb);// Line matcher
    Matcher pm = null;// Pattern matcher
    int lines = 0;
    while (lm.find()) {
    lines++;
    CharSequence cs = lm.group(); // The current line
    if (pm == null)
    pm = pattern.matcher(cs);
    else
    pm.reset(cs);
    if (pm.find())
    System.out.print(f + ":" + lines + ":" + cs);
    if (lm.end() == cb.limit())
    break;
    } // Search for occurrences of the input pattern in the given file
    private static void grep(File f) throws IOException { // Open the file and then get a channel from the stream
    FileInputStream fis = new FileInputStream(f);
    FileChannel fc = fis.getChannel(); // Get the file's size and then map it into memory
    int sz = (int)fc.size();
    MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, sz); // Decode the file into a char buffer
    CharBuffer cb = decoder.decode(bb); // Perform the search
    grep(f, cb); // Close the channel and the stream
    fc.close();
    // Try deleting the file =================================
    boolean deleted = f.delete();
    if (!(deleted)) {
    System.err.println("Could not delete file " + f.getName());
    System.exit(4);
    // End try deleting file =================================
    } public static void main(String[] args) {
    if (args.length < 2) {
    System.err.println("Usage: java Grep pattern file...");
    return;
    compile(args[0]);
    for (int i = 1; i < args.length; i++) {
    File f = new File(args);
    try {
    grep(f);
    } catch (IOException x) {
    System.err.println(f + ": " + x);

    Here is the minimal code that demonstrates this. It opens the file specified on the command line, maps it to memory, prints it out, and then tries to delete the file.
    There is no question about calling close on a File object. The close method is invoked on a stream or a channel. In the case of a channel, it should automatically close the stream. However, in this code I am closing the stream and the channel.
    import java.io.*;
    import java.nio.*;
    import java.nio.channels.*;
    import java.nio.charset.*;
    public class testFileDelete {
    public static void main(String[] args) {
              FileInputStream fis = null;
              if (args.length < 1) {
                   System.err.println("Usage: java testFileDelete <filename>");
                   System.exit(1);
              File f = new File(args[0]);
    try {
                   // Open the file
                   fis = new FileInputStream(f);
              } catch (FileNotFoundException ex) {
                   System.err.println("Error! " + ex.getMessage());
                   System.exit(2);
              try {
                   // Get a channel from the stream
                   FileChannel fc = fis.getChannel();
                   // Map the file into memory
                   MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, (int)fc.size());
                   // Do something interesting here. For this example, just print the
                   // contents of the file.
                   // Decode the file into a char buffer, so we can print the contents.
                   Charset cs = Charset.forName("8859_1");
                   CharsetDecoder cd = cs.newDecoder();
                   CharBuffer cb = cd.decode(bb);
                   // Now print it out to standard output
              System.out.print(cb);
                   // Close the channel and the stream
                   fc.close();
                   // Close the input stream even though closing the
                   // channel should do this
                   fis.close();
              } catch (IOException ex) {
                   System.err.println("Error! " + ex.getMessage());
                   System.exit(3);
              // Done processing file. Now delete it.
              boolean deleted = f.delete();
              if (!(deleted)) {
                   System.err.println("Could not delete file " + f.getName());
                   System.exit(2);

  • Delete file Application Server

    Hi ...
    I have an application wrote with Forms Dev. ... Is it possible delete a file on the application server ??
    Is it also possible delete a file in the Application server by a stored procedure ??
    Thank's in advance

    It is also possible to implement a java procedure on the database being invoked with a PL/SQL wrapper class.
    In this way (and if used right) there is also granularity regarding the filestructure permissions given and it may be called during a Forms or other PL/SQL session.
    As it is a requirement in this post to delete file from the AS, the database instance holding the JAVA class needs to be installed on the Application Server itself (which is not recommended anyway). But the article below explains a more generic approach how to invoke shell commands from within an Oracle Instance.
    Be careful with this, because it really works ;)
    Refer to :
    http://www.oracle-base.com/articles/8i/ShellCommandsFromPLSQL.php
    Message was edited by:
    user434854

  • How do you delete file from time machine back up?

    How do you delete file from time machine back up?

    This from Apple KB Article  If Time Machine is not in your Dock, you can enter Time Machine from the Menu Bar or System Preferences.
    Deleting data from a Time Machine backup
    To delete all backups of one or more items from a Time Machine backup, follow these steps:
    Click the Time Machine icon on your Dock to enter the Time Machine restore interface.
    Click on the item you would like to delete. Command-click to select multiple items.
    Control-click (or right click) the highlighted item(s) and select "Delete All Backups of..." from the contextual menu, or select "Delete all backups of..." from the Action Item menu.
    Authenticate with an administrator password when prompted.

  • HOw to delete files from remote server?

    Hi,
    I want to delete files from a directory on remote server.
    I use the following command to delete on current server:
    find $srcdir -mtime +90 -name "COR*.txt" -exec rm -f {} \;
    Now, how can I delete files from remote server ?
    Thanks!
    Yogini

    Some possible options:
    1. There exists SSH implementation for Windows.
    2. You can make a workaround. You can setup share for specific/wanted directory.
    Then you can mount it on Linux machine and execute command localy and delete files "localy" in mounted directory.
    3. You can setup FTP server on Windows machine and do that remotely via FTP commands.

Maybe you are looking for

  • Corrupted ipod error message

    I've had my ipod for about 3 years, and I haven't really had any problems. Knock on wood. I downloaded the newer version of itunes, and synced my ipod to it. Now my ipod has no music in it, and there is an error message that pops up when I plug it in

  • Query Reference Data and CFCs

    I would to run a  query once that returns a record set and pass that as reference data to functions in a ColdFusion component. Inside those functions, I'd take the query and run a query of queries for aggregate results among other things. Can this be

  • PTG102 for linux: panama_core.zip in wrapper.classpath

    Hi, I set some wrapper.classpaths in the jserv.properties as installation guide described. But after restarting apache, the ApacheJserv doesn't work anymore. I try to comment/uncomment each wrapper.classpath line and I find the panama_core.zip in <PT

  • Question on void*__Crun::vector_new function

    Hi, This is using Studio 11 on x86. I am trying to allocate a array of class using MyObject* objs = new MyObject[size]; I notice that this call occasionally ends up calling the destructor of MyObject. The size could potentially be very large. Is it p

  • Weblogic Server Switch over automatically due to too many open files error.

    Hi, I am facing problem in production environment. I am using Weblogic 8.1 SP4 application. Weblogic Server automatically switch over every 3 weeks due to few reasons. 1. out of memorry error. 2. Too many open files error. Please see my below portals