How to send a file in the server of the University Complutense of MADRID using the Code?

Hello

I tried several times to upload a file to the server of the University Complutense of Madrid from the adf page, but I can't do it.

First: I have used this method to do, but it feel that the file downloaded successfully and when I open the server I haven't found this...

public String addNewContent() {}
InputStream fileStream = null;

try {}
createConnection();
String filePath = "C:\\Users\\Administrator\\Desktop\\ucm classes\\Class1.java";
String autherName = "weblogic";
fileStream = new FileInputStream (filePath);
= New File (filePath);
String [] fileTitle = filePath.split("/");
long fileLength = new File (filePath) .length ();
param.getBinder (.putLocal (CMConstants.CM_SERVICE_NAME),
CMConstants.CM_CHECKIN);
param.getBinder () .putLocal ("dDocType", "Application");
Title of the downloaded file
param.getBinder () .putLocal ("dDocTitle", fileTitle [fileTitle.length - 1]);
Name of the author
param.getBinder () .putLocal ("dDocAuthor", autherName);
Content security for (Group and account)
param.getBinder () .putLocal ("dSecurityGroup", "Public");
param.getBinder () .putLocal ("dDocAccount", "");
param.getBinder () .putLocal ("dFormat", "text/html");
param.getBinder () .putLocal ("xCollectionID",
(getFolderIdFromPath ("/ Contribution dossiers/22 /"))) ;
param.getBinder () .addFile ("primaryFile", file);
param.setServiceResponse (param.getIdcClient (.sendRequest (param.getIdcContext ()),
(param.getBinder ()));

InputStream myInputStream = param.getServiceResponse () .getResponseStream ();
String myResponseString = param.getServiceResponse () .getResponseAsString ();
System.out.println ("downloaded file Details: \n" +)
myResponseString);

DataBinder myResponseDataBinder =
param.getServiceResponse () .getResponseAsBinder ();

System.out.println ("file uploaded successfully");
} catch {(IdcClientException idcce)
System.out.println ("IDC customer Exception occurred. Cannot download the file. Message: «+»
idcce.getMessage () + ", the stack trace:");
idcce.printStackTrace ();
} catch (IOException ioe) {}
System.out.println ("IO Exception has occurred. Cannot download the file. Message: «+»
ioe.getMessage () + ", the stack trace:");
ioe.printStackTrace ();
} catch (Exception e) {}
System.out.println ("Exception occurred. Cannot download the file. Message: «+»
e.getMessage () + ", the stack trace:");
e.printStackTrace ();
} {Finally
If (param.getServiceResponse ()! = null) {}
param.getServiceResponse (m:System.NET.Sockets.Socket.close ());
}
If (fileStream
! = null) {}try {}fileStream.close ();} catch (Exception e) {}e.printStackTrace ();}}}

Returns a null value.

}

----------------------------------------------------------------------

Second: I used this method, but it did not work also

public String uploadFile() {}
try {}
String inputFile1 ="";
UF UploadedFile = (UploadedFile) inputFile1.getValue ();
String filePath="C:\\Setup\\mmm.txt; »
InputStream fileStream = null;
try {fileStream = new FileInputStream (filePath) ;} catch (FileNotFoundException e) {}}
String [] fileTitle = filePath.split("/");
long fileLength = new File (filePath) .length ();

//DataBinder Binder = IdcClient.crea
param.getBinder (.putLocal (CMConstants.CM_SERVICE_NAME),
CMConstants.CM_CHECKIN);
param.getBinder () .putLocal ("dDocAuthor",
"weblogic"); If the user is admin, can specify any user
param.getBinder () .putLocal ("dDocTitle", "titleee");
param.getBinder () .putLocal ("dDocName", "nameee");
param.getBinder () .putLocal ("dDocType", "DigitalMedia");
param.getBinder () .putLocal ("xCollectionID",
getFolderIdFromPath ("/ files/11 Contribution")); parent folder
param.getBinder () .putLocal ("dSecurityGroup", "Public");
param.getBinder () .putLocal ("dDocAccount:", "");
param.getBinder () .putLocal ("xComments", "Review of Montreal");
param.getBinder () .putLocal ("xWCTags", "Montréal");

param.getBinder () .addFile ("primaryFile",
new TransferFile (fileStream, 'child',
fileLength,
"text/html"));
ServiceResponse response =
param.getIdcClient (.sendRequest (param.getIdcContext ()),
param.getBinder ());

} catch (Exception e) {}
System.out.Print("");
}

Returns a null value.
}

-------------------------------

Can someone tell me what's wrong? !

Thank you

This will definitely work

package demo;

import java.io.*;
import oracle.stellent.ridc.*;
import oracle.stellent.ridc.model.*;
import oracle.stellent.ridc.protocol.*;
import oracle.stellent.ridc.protocol.intradoc.*;
import oracle.stellent.ridc.common.log.*;
import oracle.stellent.ridc.model.serialize.*;
import oracle.stellent.ridc.protocol.http.*;
import java.util.List;

/*
 * This is a class used to test the basic functionality
 * of submitting a checkin to Content Server using RIDC.
 */

public class TestRIDCCheckin {

    public static void main(String[] args) {
        // Create a new IdcClientManager
        IdcClientManager manager = new IdcClientManager();
        try {
            // Create a new IdcClient Connection using idc protocol (i.e. socket connection to Content Server)
            IdcClient idcClient = manager.createClient("idc://localhost:4444");
            // Create new context using the 'sysadmin' user
            IdcContext userContext = new IdcContext("sysadmin");
            // Create an HdaBinderSerializer; this is not necessary, but it allows us to serialize the request and response data binders
            HdaBinderSerializer serializer = new HdaBinderSerializer("UTF-8", idcClient.getDataFactory());

            // Databinder for checkin request
            DataBinder dataBinder = idcClient.createBinder();
            dataBinder.putLocal("IdcService", "CHECKIN_UNIVERSAL");
            //dataBinder.putLocal("dDocName","TestRIDCCheckin");
            dataBinder.putLocal("dDocTitle", "Test RIDC Checkin");
            dataBinder.putLocal("dDocType", "Document");
            dataBinder.putLocal("dDocAccount", "");
            dataBinder.putLocal("dSecurityGroup", "Public");
            dataBinder.addFile("primaryFile", new File("c:/test.txt"));

            //dataBinder.putLocal("doFileCopy", "1");

            // Write the data binder for the request to stdout
            serializer.serializeBinder(System.out, dataBinder);
            // Send the request to Content Server
            ServiceResponse response = idcClient.sendRequest(userContext, dataBinder);
            // Get the data binder for the response from Content Server
            DataBinder responseData = response.getResponseAsBinder();
            // Write the response data binder to stdout
            serializer.serializeBinder(System.out, responseData);

        } catch (IdcClientException ice) {
            ice.printStackTrace();
        } catch (IOException ioe) {
            ioe.printStackTrace();
        }
    }

}

Tags: Fusion Middleware

Similar Questions

  • How to send a file to the cloud?

    (1) how to send a file to the cloud?

    (2) at - it a difficulty to find and recover a file that has been sent to the cloud? If the use is similar to the use of an external hard drive, I don't mind.

    The following contains information on how to activate and use iCloud drive. Note that with iCloud as it exists currently with OS X El Capitan, for any file stored in iCloud drive a local copy is also stored on your Mac.

    iCloud Drive FAQ - Apple Support

  • How to identify resource files in the cod file?

    I want to create a file manager application, I put some png files in the "res/img/iconSet /" folder that the images of the icons, some files are named in this form: "rar_zip_7z.png"(une icône pour le fichier 3), so as a first step, I can analyze the file name and build a relationship between the type of image and icon file. ""

    My question is is there a method to list the resource files in the cod file, like list() in FileConnection?

    Yes, seems no way to I have generate a list on pc and read it as a workaround.

  • How to send a file to the server using the flash?.

    How can I send a photo for example to set up a virtual catalog and preview my album?
    I use a simple form with 5 fields of transmission and the small image after submission.

    If you want to download a file to your server using flash, use the Flash filereference class (and its upload() method) and backend scripts.

  • How to share several files at the same time?

    iI am trying to share a number of edited files and sending one at a time takes too much time. How to share several files at the same time?

    Yes, you can select and send/share several files at once.

    Start https://cloud.acrobat.com/send. Click Select files to send and then follow the instructions in file selection. If you want to add more files, simply click on add files:

    You can include up to 50 files by "transaction".

  • How to send / receive files via Wifi Direct... ?

    I found this bike e wifi Direct support. I tried to send files via wifi direct, but I couldn't.

    How to send / receive files with direct wifi without installing any 3rd party application... ?

    Uses of direct wifi... ?

    Sorry about that. Can be a regional thing, I'm not familiar with.

    Back to my question - what types of files you try to move?

  • How read datalog multiple files at the same time?

    Hello friends...

    can someone help me to show how read datalog multiple files at the same time?

    Here is the example of my case.

    I have 500 files in a folder. each file contains a waveform and its setting.

    and then I want to do a card spectral these files, because these files have been saved in the order.

    the point is to know how to read these 500 files at once? I made a program to read these files, but the program can read these files in one by one. So it is very uncomfortable to read 500 files one by one. can someone help me solve this problem? Thank you. I hope you can show me the program. Thank you again...

    Hi jojo,

    Well, in the range of functions daughter, you will find a function to list the contents of the folder. This allows to get the names of all the files datalog, and then use a loop FOR to read.

    No one is obliged to provide 500 names of files manually - that's why we use a programming language to let the computer do the stupid work

  • How to open a file with the extension .odg using Vista?

    How to open a file with the extension .odg using Vista?

    Hi Defiant503,

    Thank you for visiting the forums of answers.microsoft.com.

    I did some research and a file ending with .odg is an OpenDocument Document OpenOffice/StarOffice (Ver 2) of graphics by Sun Microsystems, Inc.    This means that in order to open this file, you will need this program to open it.  You will not be able to open this file with Vista.

    I hope this information helps.

    Kavita M
    Microsoft Answers Support Engineer
    Visit the Microsoft Answers Feedback Forum site
    and let us know what you think.

  • How to send an email to the entire group

    Original title: sending a group e-mail

    I created a group in my contacts, but don't know how to send an email to the entire group.   When I type in the name of Group 5 of the 25 show upward.   I'm doing something wrong.

    You will need to provide much more information.  For example, what email program are you using?  Is it perhaps Windows Live Mail 2012?

  • I can't have multiple files open at the same time! I need to compare the content from one to the other. How to display two files at the same time?

    I can't have multiple files open at the same time! I need to compare the content from one to the other. How to display two files at the same time?

    Hi sindres79946597,

    Open Acrobat Reader DC, navigate to the Edit-> Preferences-> General-> uncheck "Open Documents in the new tab in the same window.

    Now, reboot your system, when you open multiple PDFs that all will open in a new window so that you can easily compare.

    Kind regards
    Nicos

  • How to open a file with the extension x3f (sigma)

    How to open a file with the extension x3f (sigma)?

    Doesn't look good: Lightroom / Camera Raw: Sigma SD1 - when Merrill sensors will benefit, please!

  • How can I transfer files to the cloud?

    How can I transfer files to the cloud?

    The first thing to do is to transfer a copy of the file / files out of your Onedrive account to your computer.
    Then go to https://cloud.acrobat.com/ where you can sign if necessary.
    Then, download the files that you want to the section "Files" of your account.

    Submit a Word file to PDF Pack you'll want the file / files available on their computer for submission to the subscription to the service.

    Be well...

  • How to print a file of the 8 page to this page after 2 follow 7, then 6-3-4-5?

    How to print a file of the 8 page to this page after 2 follow 7, then 6-3-4-5?

    Use file > print booklet and go through the settings.

    It's perhaps a bit of trial and error - also don't forget to check your printer for duplex printing options and the size and orientation of the page too.

  • See the news feed from the University Complutense of MADRID to the Webcenter Portal

    Hello

    I'm new to AAU and Webcenter portal technology. I have a requirement to display the contents of RSS feeds which is kept at the Complutense University of MADRID and to display in a webcenter portal.
    Please guide me on how can I achieve this. What all the technology that I use.

    Sahar

    Hello Sahar,

    There are at least two options:

    (1) query metadata (UCM) and host content (PGC)
    (2) RSS feed component (UCM) and RSS task Flow (WCP)

    Ad 1) take a look at this tutorial: http://www.yonaweb.be/webcenter_tutorial/using_content_presenter_templates

    In a Word, your 'news' can be any content stored in the University Complutense of MADRID, defined by its metadata. To view it, you can create a template according to your needs.

    AD 2) could not work any longer.

    The idea is to use get news RSS FEEDS and display them. As part of the WCP, there will be no problem - for more details, see http://docs.oracle.com/cd/E23943_01/webcenter.1111/e10149/rss.htm#WCSUG1384
    I don't know, however, for the part of the Complutense University of MADRID. There used to be a component that has enabled the sharing of content as RSS feeds. The component is available at http://www.oracle.com/technetwork/middleware/webcenter/content/rssfeeds-129386.zip
    Unfortunately, it seems in 11g were dropped (I could find no reference to this in the docs of 11g), however, it might still work - see the discussion in the activation of the RSS FEED at the Complutense University of MADRID

    If you want to go this way, you will need to test / fix it yourself.

    Jiri

  • Authentication and authorization JPSUserProvider at the University Complutense of MADRID 11g

    Hello

    Can someone direct me on where I can find more information on JPSUserProvider. Documentation of the Complutense University of MADRID just mentions that JPSUserProvider is configured in the UCM by default and used for authentication, the authorization. In another document that it is mentioned that UCM 11 g has nothing to do with the authentication of the user, all the authentication will be supported by Weblogic and SSO must be configured against weblogic. If SSO is configured and an external LDAP is used as a user store in weblogic, I need to make changes to the AAU? I want to know the role JSPUserProvider plays in the University Complutense of MADRID and the series of events that take place after the user enters the credentials to < Server >: < port > / cs/login/login.htm.
    Any help in pointing the right resources is appreciated.

    Thank you
    Shyam

    Sometimes, you don't have no need to make changes, but other times, you may need to update the map attribute, the delimiter of account permissions, default roles and/or accounts. Occasionally, an ID card is applied to translate incoming AD group names to match the role names and/or account UCM.

    Meet real external LDAP permissions is made via the WLS, but the JPSProvider does the work of extracting data from WLS in object UserData of the AAU.

    -ryan

Maybe you are looking for

  • Satellite A300 - Win 7 - newnext.me missing negine.dll

    Whenever I start my laptop, I get an error message: "+ There was a problem starting.+C:\Users\Toshiba\AppData\Roaming\newnext.me\negin + e.dll + The specified module could not be found. +" Laptop otherwise seems fine.I use Windows 7 with AVG. Your fa

  • People contacts courier

    People off of your contacts can see your messages if you send?

  • Cannot connect iPhone and Macbook Pro with AirDrop and bluetooth

    Hello. I recently bought an iPhone 6 and I want to use Airdrop, but I can't find my iPhone on Mac and my Mac on iPhone. When I click bluetooth, then click on connect, it does not connect and on my iPhone it says I should check if my Mac is at hand. A

  • Using Apple TV on MacBook, iPhone or iPad?

    How can get Apple TV to show on my other Apple devices? How can I see/control the Apple TV on my MacBook Pro (retina), 2 (retina) mini iPad or iPhone 6? I have Instead of watching on my TV, I would like to watch it from my laptop or iPad sometimes, b

  • Able to connect to the Internet, but not be able to access router settings

    I can connect to the Internet fine, ping works, but I can't connect to the router settings. Specifications Router IP: 192.168.1.1 IP address: 192.168.1.150 USING static IP Browser: Safari Error message: Safari cannot open the page because the server