Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

probkem in copying a file to another directory

Tarek FathyJun 25 2013 — edited Jun 26 2013

hi

my page contains  af:inputfile.

<af:inputFile label="#{viewcontrollerBundle.SELECT_FILE}" id="if1" value="#{docbean.file}"/>

the user should use this page to browse any file in his machine and uploaded to server

I use  FileUtils.copyFileToDirectory() to copy the file to the directory. this method comes from org.apache.myfaces.trinidad.model.UploadedFile;

This is the method body

import org.apache.myfaces.trinidad.model.UploadedFile;

....

    public void uploadToServer(ActionEvent actionEvent) {

        UploadedFile myFile = (UploadedFile)this.getFile();      

            File outputFile =        

                new File("D:\\SystemsData\\ScannedFiles\\" + this.getCurrentDocId() + ".tif");

            try {

                FileUtils.copyFileToDirectory((File)myFile, outputFile);

            } catch (IOException e) {

                e.printStackTrace();

            }

at run time when I press upload button I get this error

java.lang.ClassCastException: org.apache.myfaces.trinidadinternal.config.upload.UploadedFiles$FixFilename cannot be cast to java.io.File

My Question is:

how to cast org.apache.myfaces.trinidadinternal.config.upload.UploadedFiles  to java.io.File

This post has been answered by Timo Hahn on Jun 26 2013
Jump to Answer

Comments

661621
Do you want to change the linking between OIM Exchange connector and attribute proxy addresses? If you have the Exchange 9.1 connector that would be easy using attribute mapping. Could you specify the connector version.
661915
Hashtable ht = new Hashtable();
Vector msv = new Vector();
Vector msv1 = new Vector();
msv.add("SMTP:xxxx@gmail.com");
msv.add("smtp:zzzzzz@yahoo.co.in");
msv.add("X400:c=US;a= ;p=First Organizati;o=Exchange;s=gupta;g=vineet");
msv1.add("{26491CFC-9E50-4857-861B-0CB8DF22B5D7}");
ht.put("proxyAddresses", msv);
ht.put("msExchPoliciesExcluded", msv1);

and call Exchange apis passing this hashtable
1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 24 2013
Added on Jun 25 2013
2 comments
458 views