Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

darobin (1316)

darobin
  (email not shown publicly)
http://berjon.com/

Journal of darobin (1316)

Monday February 24, 2003
10:24 AM

Copying a file in Java

[ #10754 ]

If you need some extra ammo to convince your Java-coding friends(?) that they have strayed far from common sense, ask them how to copy a file in Java (look at the two given options). No, java.io.File has rename and delete, but no copy.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • LOL (Score:3, Funny)

    by mir (51) <xmltwig@gmail.com> on 2003.02.24 10:57 (#17428) Homepage Journal

    That Java thing is really kewl, here is what the link let too:

    HTTP Status 500 - Internal Server Error

    type Exception report

    message Internal Server Error

    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.

    exception

    java.lang.reflect.InvocationTargetException
        at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav a:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at com.ee.servlet.HandleJspServlet.invoke(HandleJspServlet.java:114)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex t(StandardPipeline.java:641)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    &nb sp;   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
    &nbs p;   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex t(StandardPipeline.java:643)
        at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java :170)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex t(StandardPipeline.java:641)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex t(StandardPipeline.java:641)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    &nb sp;   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174 )
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex t(StandardPipeline.java:643)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    &nb sp;   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:458)
        at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:551)
        at java.lang.Thread.run(Thread.java:536)
    Caused by: com.TeamNoggin.util.DBManager$InvalidDBException: com.TeamNoggin.util.OracleDataSourceManager: error calling releaseConcreteConnection - ORA-00020: maximum number of processes (610) exceeded

        at com.ee.util.SessionUtil.createSession(SessionUtil.java:97)
        ... 23 more

    Apache Tomcat/4.1.18-LE-jdk14
    --
    mirod
  • I also got the error message. I believe, though, you can write a system call to copy the file, but that would become system-dependent (cp vs. COPY).

    Jason
  • Something similar came up on perlmonks a while ago. I posted some java solutions that were as fast as perl, and not nearly as verbose as the solutions given on experts-exchange. They require JDK 1.4 though.

    http://www.perlmonks.org/index.pl?node_id=148355

    cheers,

      - danboo