Implementation of Z-modem protocol in Java

Hi,
I want to send a file from serial port and I have to use the Z-modem protocol in Java. I saw the protocol and it looks defficult for me and I can't buy a commercial solution. Any Idea how can I get it easyer?
Thank you for the help.

how is this question related to CLDC or MIDP?

Similar Messages

  • After running ridc to checkin file into Oracle Content Center Server there is error: oracle.stellent.ridc.protocol.ProtocolException: java.io.IOException: Input terminated before being able to read line

    Hi,
       I use ridc to check in file into Oracle Center Content server. There is no problem at the beginning. But after running for several days, there is following error.
    I must restart my program to solve this issue.
       Can anyone help me solve this problem?
    Thanks,
    Tony
    2013-07-11 12:24:31,189 ERROR [BatchEventHandler] com.edocs.common.api.integration.contmgmt.ContentException: oracle.stellent.ridc.protocol.ProtocolEx
    ception: java.io.IOException: Input terminated before being able to read line
            at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:95)
            at com.edocs.common.reporting.batch.BatchEventHandler.processBatchRequest(BatchEventHandler.java:284)
            at com.edocs.common.reporting.batch.BatchEventHandler.service(BatchEventHandler.java:138)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.executeInternal(BatchReportProcessorTask.java:156)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.doProcessTask(BatchReportProcessorTask.java:68)
            at com.edocs.pwc.tasks.CommonTask.processTask(CommonTask.java:166)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.__WL_invoke(Unknown Source)
            at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.processTask(Unknown Source)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl_WLSkel.invoke(Unknown Source)
            at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:85)
            at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
            at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
            at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
            at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: oracle.stellent.ridc.protocol.ProtocolException: java.io.IOException: Input terminated before being able to read line
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:149)
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:108)
            at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:81)
            ... 17 more
    Caused by: java.io.IOException: Input terminated before being able to read line
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readLine(HdaBinderSerializer.java:371)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readToEnd(HdaBinderSerializer.java:335)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:165)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:71)
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:126)
            ... 19 more
    2013-07-11 12:24:33,005 ERROR [BatchEventHandler] com.edocs.common.api.integration.contmgmt.ContentException: oracle.stellent.ridc.protocol.ProtocolEx
    ception: java.io.IOException: Input terminated before being able to read line
            at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:95)
            at com.edocs.common.reporting.batch.BatchEventHandler.processBatchRequest(BatchEventHandler.java:284)
            at com.edocs.common.reporting.batch.BatchEventHandler.service(BatchEventHandler.java:138)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.executeInternal(BatchReportProcessorTask.java:156)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.doProcessTask(BatchReportProcessorTask.java:68)
            at com.edocs.pwc.tasks.CommonTask.processTask(CommonTask.java:166)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.__WL_invoke(Unknown Source)
            at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.processTask(Unknown Source)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl_WLSkel.invoke(Unknown Source)
            at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:85)
            at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
            at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
            at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
            at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: oracle.stellent.ridc.protocol.ProtocolException: java.io.IOException: Input terminated before being able to read line
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:149)
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:108)
            at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:81)
            ... 17 more
    Caused by: java.io.IOException: Input terminated before being able to read line
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readLine(HdaBinderSerializer.java:371)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readToEnd(HdaBinderSerializer.java:335)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:165)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:71)
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:126)
            ... 19 more
    2013-07-11 12:24:37,870 ERROR [BatchEventHandler] com.edocs.common.api.integration.contmgmt.ContentException: oracle.stellent.ridc.protocol.ProtocolEx
    ception: java.io.IOException: Input terminated before being able to read line
            at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:95)
            at com.edocs.common.reporting.batch.BatchEventHandler.processBatchRequest(BatchEventHandler.java:284)
            at com.edocs.common.reporting.batch.BatchEventHandler.service(BatchEventHandler.java:138)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.executeInternal(BatchReportProcessorTask.java:156)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.doProcessTask(BatchReportProcessorTask.java:68)
            at com.edocs.pwc.tasks.CommonTask.processTask(CommonTask.java:166)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.__WL_invoke(Unknown Source)
            at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.processTask(Unknown Source)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl_WLSkel.invoke(Unknown Source)
            at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:85)
            at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
            at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
            at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
            at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: oracle.stellent.ridc.protocol.ProtocolException: java.io.IOException: Input terminated before being able to read line
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:149)
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:108)
            at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:81)
            ... 17 more
    Caused by: java.io.IOException: Input terminated before being able to read line
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readLine(HdaBinderSerializer.java:371)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readToEnd(HdaBinderSerializer.java:335)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:165)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:71)
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:126)
            ... 19 more
    2013-07-11 12:24:39,722 ERROR [BatchEventHandler] com.edocs.common.api.integration.contmgmt.ContentException: oracle.stellent.ridc.protocol.ProtocolEx
    ception: java.io.IOException: Input terminated before being able to read line
            at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:95)
            at com.edocs.common.reporting.batch.BatchEventHandler.processBatchRequest(BatchEventHandler.java:284)
            at com.edocs.common.reporting.batch.BatchEventHandler.service(BatchEventHandler.java:138)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.executeInternal(BatchReportProcessorTask.java:156)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.doProcessTask(BatchReportProcessorTask.java:68)
            at com.edocs.pwc.tasks.CommonTask.processTask(CommonTask.java:166)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.__WL_invoke(Unknown Source)
            at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.processTask(Unknown Source)
            at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl_WLSkel.invoke(Unknown Source)
            at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:85)
            at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
            at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
            at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
            at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: oracle.stellent.ridc.protocol.ProtocolException: java.io.IOException: Input terminated before being able to read line
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:149)
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:108)
            at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:81)
            ... 17 more
    Caused by: java.io.IOException: Input terminated before being able to read line
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readLine(HdaBinderSerializer.java:371)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readToEnd(HdaBinderSerializer.java:335)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:165)
            at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:71)
            at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:126)
            ... 19 more

    The following is my testing code.
    package ebilling;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.security.SecureRandom;
    import java.text.SimpleDateFormat;
    import java.util.ArrayList;
    import java.util.Calendar;
    import java.util.List;
    import java.util.Properties;
    import java.util.concurrent.LinkedBlockingQueue;
    import java.util.concurrent.ThreadPoolExecutor;
    import java.util.concurrent.TimeUnit;
    import oracle.stellent.ridc.IdcClient;
    import oracle.stellent.ridc.IdcClientManager;
    import oracle.stellent.ridc.IdcContext;
    import oracle.stellent.ridc.model.DataBinder;
    import oracle.stellent.ridc.model.DataObject;
    import oracle.stellent.ridc.model.DataResultSet;
    import oracle.stellent.ridc.model.TransferFile;
    import oracle.stellent.ridc.protocol.ServiceResponse;
    import org.apache.commons.lang.StringUtils;
    public class UCMContentManager {
         * Check in a file into a Oracle WebCenter Content Server and return content id of uploaded content item in Oracle WebCenter Content Server.    
         * @param properties        The Oracle WebCenter Content Server connection properties.
         * @param contentFile       This file will be checked in a Oracle WebCenter Content Server.
         * @param path              The location path of checked in file in Oracle WebCenter Content Server. This path includes the file name.<br>
         *                             For example, "/folder1/folder2/file1.txt". The "file1.txt" is the file name part. <br>
         *                             The file name will be used as dDocName in Oracle WebCenter Server. It must be unique.<br>
         * @throws ContentException The exception when uploading file into Oracle WebCenter Content Server.
         * @return                  The content id of uploaded content item in Oracle WebCenter Content Server.
        public String saveContent(Properties properties, File contentFile, String path) throws ContentException{
            if(path.endsWith(SLASH)) {
                throw new ContentException("Require file name in Content Management Server");
            if(!path.startsWith(SLASH)) {
                throw new ContentException("The file store path in Content Management Server should be absolute.");
            if (path.indexOf("//") != -1) {
                path = path.replace("//", SLASH);
            String[] paths = path.split(SLASH);       
            String[] parents = new String[paths.length - 1];
            String itemName = paths[paths.length-1];
            System.arraycopy(paths, 0, parents, 0, paths.length-1);
            ServiceResponse response = null;
            try {
                IdcClientManager manager = new IdcClientManager();
                IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
                client.getConfig().setProperty ("http.library", "apache4");
                String user = properties.getProperty(USERNAME_PROPERTY);
                String pwd = properties.getProperty(PASSWORD_PROPERTY);
                IdcContext connectionContext = new IdcContext(user, pwd);
                pwd = null;
                //create the parent folders if they don't exist
                String folderGUID = makeFolders(properties, parents);
                //check in the file
                DataBinder requestData = client.createBinder();
                requestData.putLocal("IdcService", "CHECKIN_UNIVERSAL");
                requestData.putLocal("IsJava", "1");
                requestData.putLocal("dDocName", itemName);           
                requestData.putLocal("dDocTitle", itemName);           
                requestData.putLocal("dDocType", "Binary");
                requestData.putLocal("dSecurityGroup", "Public");
                requestData.addFile("primaryFile", new TransferFile(contentFile));
                response = client.sendRequest(connectionContext, requestData);           
                DataBinder responseData = response.getResponseAsBinder();
                //String did = responseData.getLocal("dID");           
                String dDocname = responseData.getLocal("dDocName");
                closeResponse(response);
                //link the file in a folder
                requestData = client.createBinder();
                requestData.putLocal("IdcService", "FLD_CREATE_FILE");
                requestData.putLocal("fParentGUID", folderGUID);
                String fileType = "owner";
                requestData.putLocal("fFileType", fileType);           
                requestData.putLocal("dDocName", dDocname);           
                response = client.sendRequest(connectionContext, requestData);
                return dDocname;
            } catch (Throwable e) {
                throw new ContentException(e);
            } finally{
                closeResponse(response);
        public void deleteContent(Properties properties, String contentId) throws ContentException{
            List<String> didList = getDIds(properties, contentId);
            contentId = contentId.toUpperCase();
            ServiceResponse    response = null;
            try {           
                IdcClientManager manager = new IdcClientManager();
                IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
                client.getConfig().setProperty ("http.library", "apache4");
                String user = properties.getProperty(USERNAME_PROPERTY);
                String pwd = properties.getProperty(PASSWORD_PROPERTY);
                IdcContext connectionContext = new IdcContext(user, pwd);
                pwd = null;
                DataBinder requestData = null;
                for(int i=0; i<didList.size(); i++) {
                    String did = didList.get(i);
                    requestData = client.createBinder();
                    requestData.putLocal("IdcService", "DELETE_DOC");
                    requestData.putLocal("dDocName", contentId);               
                    requestData.putLocal("dID", did);   
                    response = client.sendRequest(connectionContext, requestData);
                    closeResponse(response);
                    //delete parent folder
    //                try {
    //                    requestData = client.createBinder();           
    //                    requestData.putLocal("IdcService", "FLD_DELETE");       
    //                    requestData.putLocal("item1", "path:" + parentPath);
    //                    requestData.putLocal("constructDialog", "1");
    //                    response = client.sendRequest(connectionContext, requestData);
    //                } catch (Exception e) {
    //                    // TODO: handle exception
            } catch (Exception e) {
                throw new ContentException(e);
            } finally {
                closeResponse(response);
        public int getFileCountInFolder(Properties properties, String path) throws ContentException{
            ServiceResponse    response = null;
            try {
                IdcClientManager manager = new IdcClientManager();
                IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
                client.getConfig().setProperty ("http.library", "apache4");
                String user = properties.getProperty(USERNAME_PROPERTY);
                String pwd = properties.getProperty(PASSWORD_PROPERTY);
                IdcContext connectionContext = new IdcContext(user, pwd);
                pwd = null;
                DataBinder binder = client.createBinder();
                binder.putLocal("IdcService", "FLD_BROWSE");
                binder.putLocal("path", path);
                response = client.sendRequest(connectionContext, binder);
                DataBinder result = response.getResponseAsBinder();
                String num = result.getLocal("numFiles");
                return Integer.parseInt(num);
            catch (Exception e) {
                throw new ContentException(e);
            } finally {
                closeResponse(response);
        private String getFolderGUID(Properties properties, String path) throws ContentException {
            ServiceResponse    response = null;       
            String tmpFolderGUID = null;
            try {
                IdcClientManager manager = new IdcClientManager();
                IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
                client.getConfig().setProperty ("http.library", "apache4");
                String user = properties.getProperty(USERNAME_PROPERTY);
                String pwd = properties.getProperty(PASSWORD_PROPERTY);
                IdcContext connectionContext = new IdcContext(user, pwd);
                pwd = null;   
                DataBinder requestData = client.createBinder();
                requestData.putLocal("IdcService", "FLD_INFO");
                requestData.putLocal("path", path);       
                response = client.sendRequest(connectionContext,
                        requestData);
                DataResultSet result = response.getResponseAsBinder().getResultSet("FolderInfo");
                tmpFolderGUID = result.getRows().get(0).get("fFolderGUID")
                    .toString();
                if(StringUtils.isBlank(tmpFolderGUID))
                    tmpFolderGUID = null;           
            } catch (Exception e) {               
            } finally {
                closeResponse(response);
            return tmpFolderGUID;
        public boolean deleteFolder(Properties properties, String path) throws ContentException {
            if(getFolderGUID(properties, path)==null)       
                return false;
            int fileCount = getFileCountInFolder(properties, path);
            ServiceResponse    response = null;
            if(fileCount==0) {
                try {
                    IdcClientManager manager = new IdcClientManager();
                    IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
                    client.getConfig().setProperty ("http.library", "apache4");
                    String user = properties.getProperty(USERNAME_PROPERTY);
                    String pwd = properties.getProperty(PASSWORD_PROPERTY);
                    IdcContext connectionContext = new IdcContext(user, pwd);
                    pwd = null;               
                    DataBinder binder = client.createBinder();   
                    binder.putLocal("IdcService", "FLD_DELETE");       
                    binder.putLocal("item1", "path:" + path);
                    binder.putLocal("constructDialog", "1");
                    response = client.sendRequest(connectionContext, binder);
                    return true;
                catch (Exception e) {
                    throw new ContentException(e);
                } finally {
                    closeResponse(response);
            } else {
                return false;
        private String buildPath(String[] arr, int i) {
            StringBuilder buf = new StringBuilder();
            for(int j=0; j<=i; j++) {
                buf.append(arr[j]);
                buf.append(SLASH);
            return buf.toString();
        private String makeFolders(Properties properties, String[] paths) throws ContentException{
            String folderGUID = "";
            ServiceResponse response = null;
            try {
                IdcClientManager manager = new IdcClientManager();
                IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
                client.getConfig().setProperty ("http.library", "apache4");
                String user = properties.getProperty(USERNAME_PROPERTY);
                String pwd = properties.getProperty(PASSWORD_PROPERTY);
                IdcContext connectionContext = new IdcContext(user, pwd);
                pwd = null;
                String parentFolderGUID = null;
                for(int i=0; i<paths.length; i++) {
                    String fullPath = buildPath(paths, i);
                    DataBinder requestData = null;                   
                    parentFolderGUID = folderGUID;
                    folderGUID = getFolderGUID(properties, fullPath);
                    boolean exists = folderGUID!=null;
                    DataResultSet result = null;               
                    if(!exists) {
                        //create new folder
                        try {
                            requestData = client.createBinder();                   
                            requestData.putLocal("IdcService", "FLD_CREATE_FOLDER");
                            requestData.putLocal("fParentGUID", parentFolderGUID);
                            requestData.putLocal("fFolderName", paths[i]);
                            response = client.sendRequest(connectionContext, requestData);
                        } finally {
                            closeResponse(response);
                        //retrieve folderGUID of new folder
                        folderGUID = getFolderGUID(properties, fullPath);                   
            } catch (Throwable e) {
                throw new ContentException(e);
            } finally{
                closeResponse(response);
            return folderGUID;
        public List<String> getDIds(Properties properties, String contentId) throws ContentException{
            contentId = contentId.toUpperCase();
            List<String> didList = new ArrayList<String>();
            ServiceResponse    response = null;
            try {
                IdcClientManager manager = new IdcClientManager();
                IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
                client.getConfig().setProperty ("http.library", "apache4");
                String user = properties.getProperty(USERNAME_PROPERTY);
                String pwd = properties.getProperty(PASSWORD_PROPERTY);
                IdcContext connectionContext = new IdcContext(user, pwd);
                pwd = null;
                DataBinder requestData = null;
                requestData = client.createBinder();
                requestData.putLocal("IdcService", "GET_SEARCH_RESULTS");
                requestData.putLocal("SortField", "dInDate");
                requestData.putLocal("SortType", "DESC");
                requestData.putLocal("QueryText", "dDocName <matches> `" + contentId +"`");
                response = client.sendRequest(connectionContext, requestData);
                DataBinder result = response.getResponseAsBinder();
                DataResultSet resultSet = result.getResultSet("SearchResults");
                for (DataObject dataObject : resultSet.getRows()) {
    //                System.out.println("ID : " + dataObject.get("dID")+" dDocName : "
    //                        + dataObject.get("dDocName") + " Title : " + dataObject.get("dDocTitle")
    //                        + " Author : " + dataObject.get("dDocAuthor") + " Security Group : "
    //                        + dataObject.get("dSecurityGroup"));
                    String did = dataObject.get("dID");
                    didList.add(did);
                    //break;
            } catch (Exception e) {
                throw new ContentException(e);
            } finally{
                closeResponse(response);
            return didList;
         * Get the file content represented by contentId from a Oracle WebCenter Content Server.
         * The return value is the input stream of retrieved file content.
         * @param properties        The Oracle WebCenter Content Server connection properties.
         * @param contentId         The Content ID for the content item in Oracle WebCenter Content Server.
         * @throws ContentException The exception when retrieving content from Oracle WebCenter Content Server.
         * @return                  The input stream of retrieved file content.
        public InputStream retrieveContent(Properties properties, String contentId) throws ContentException{
            try {
                return new FileInputStream(retrieveContentFile(properties, contentId));
            } catch (Throwable e) {
                throw new ContentException(e);
        public File retrieveContentFile(Properties properties, String contentId) throws ContentException {
            contentId = contentId.toUpperCase();
            ServiceResponse response = null;
            try {
                IdcClientManager manager = new IdcClientManager();
                IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
                client.getConfig().setProperty ("http.library", "apache4");
                String user = properties.getProperty(USERNAME_PROPERTY);
                String pwd = properties.getProperty(PASSWORD_PROPERTY);
                IdcContext connectionContext = new IdcContext(user, pwd);
                pwd = null;
                DataBinder binder = client.createBinder();
                binder.putLocal("IdcService", "GET_FILE");
                //binder.putLocal("dID", dID);
                binder.putLocal("dDocName", contentId);
                binder.putLocal("RevisionSelectionMethod", "Latest");
                response = client.sendRequest(connectionContext, binder);
                InputStream in = null;
                OutputStream out = null;
                String edxhome = System.getProperty("edx.home");
                File tmpParent = new File(edxhome);
                tmpParent = new File(tmpParent, "Output");
                tmpParent = new File(tmpParent, "tmp");
                tmpParent.mkdirs();
                File tmpFile = File.createTempFile("down_", "_ucm", tmpParent);
                tmpFile.deleteOnExit();
                try {
                    in = response.getResponseStream();
                    out = new FileOutputStream(tmpFile);
                    byte[] buf = new byte[1024];
                    int read = -1;
                    while((read = in.read(buf))!=-1) {
                        out.write(buf, 0, read);
                } finally{
                    try {
                        if(in!=null)
                            in.close();
                    } catch (Exception e2) {
                    try {
                        if(out!=null)
                            out.close();
                    } catch (Exception e2) {
                return tmpFile;
            } catch (Throwable e) {
                throw new ContentException(e);
            } finally{
                closeResponse(response);
        private void closeResponse(ServiceResponse response) {
            if(response!=null) {
                try {
                    response.close();
                } catch (Exception e) {
        private static final String SLASH = "/";   
        private static final String URL_PROPERTY = "contentServerURL";
        private static final String USERNAME_PROPERTY = "contentServerUser";
        private static final String PASSWORD_PROPERTY = "contentServerPassword";
        static volatile boolean flag = false;
        static class UploadTask implements Runnable{
            public void run() {           
                try {
                    while(!flag) {
                        UCMContentManager manager = new UCMContentManager();
                        Properties properties = new Properties();
                        properties.put(URL_PROPERTY, "https://slc402124:16201/cs/idcplg");
                        properties.put(USERNAME_PROPERTY, "weblogic");
                        properties.put(PASSWORD_PROPERTY, "weblogic1");
                        File contentFile = new File("C:/toding/mypro/UCM/test.txt");
                        String parentPath = "/new/test/multiThreadUpload/";
                        String location = makePath(parentPath);
                        manager.saveContent(properties, contentFile, location);
                        System.out.println(location);
                        Thread.sleep(5000);
                } catch (Exception e) {
                    e.printStackTrace();
                    flag = true;
        public static void main(String[] args) throws Exception{
            ThreadPoolExecutor executor = new ThreadPoolExecutor(10, 10, 60, TimeUnit.SECONDS,
                     new LinkedBlockingQueue<Runnable>());
            for(int i=0; i<10; i++) {
                 UploadTask uploadTask = new UploadTask();
                 executor.execute(uploadTask);
            while(!flag) {
                Thread.sleep(5000);
            executor.shutdown();
        public static String makePath(String parentPath) {
            StringBuilder buf = new StringBuilder();
            buf.append(parentPath);
            if(!parentPath.endsWith("/")) {
                buf.append("/");
            Calendar rightNow = Calendar.getInstance();
            String pattern = "yyyyMMdd";
            SimpleDateFormat simDateForm = new SimpleDateFormat(pattern);
            String dateStr = simDateForm.format((rightNow).getTime());       
            pattern = "HHmmssSSS";
            simDateForm = new SimpleDateFormat(pattern);
            String timeStr = simDateForm.format((rightNow).getTime());
            buf.append(dateStr);
            buf.append("/");
            buf.append(timeStr);
            buf.append("_");
            buf.append(random.nextInt(10000));
            String finalLocation = buf.toString();
            return finalLocation;
        private static SecureRandom random = new SecureRandom();

  • BI-IP implementation in BI 7.0(NUC)+ Java Add-In(UC) system

    Hi Experts,
    We want to implement BI-IP in our existing SAP BI 7.0 system which we upgraded from BW 3.5 to BI 7.0 followed by adding the Java Add-In. During the installation of the Java Add-In central instance the BI-Java, EP Core & EP software units were selected as well, so technically this system has all the components needed for the BI-IP implementation i.e BI(ABAP), AS Java/EP/EPC, BI(Java), the question or concern now raised is
    "As we know BI 7.0 is a non-unicode setup, while Java Add -In is a unicode setup", will a combination of the unicode & non-unicode in the same BI server be able to be utilized for the BI-IP implementation purpose?, does SAP support such combination?.
    Please advice if the BI-JAVA & BI-ABAP installed in the same BI7.0 system utilizing unicode & non-unicode kernel will work for the BI-IP implementation just like it works under scenario where BI-JAVA, EP, EPC are running under the EP7.0 system & BI-ABAP is running in the BI7.0 system.
    Find attached some info on the BI, ECC6 & EP systems.
    ECC6: It was upgraded from R3 4.6C to ECC6, It's on AIX 5.2, Oracle 10.2 & Kernel is Non- Unicode
    EP 7.0: It was upgraded from EP 6.0 to 7.0. It's on AIX 5.2, Oracle 10.2 & Kernel is Unicode
    BI 7.0: It was upgraded from BW 3.5 to BI 7.0 with Java Add-In installed later, It's on AIX 5.2, Oracle 10.2, ABAP kernel is Non-Unicode, Java kernel is Unicode
    Thanks & Rgds,
    Abhishek

    I'm in exactly the same boat.
    BI Publisher is a COM Add-In... Clicking the GO... with COM Add-In selected gives me an unselected BI Publisher Template Builder for Word and the following statement for Load Behavior:
         Not Loaded. A runtime error occurred during the loading of the COM Add-in.
    Any thoughts?
    Thanks,
    Rich

  • Tutorials to implement Flash Islands with Web Dynpro Java

    Hi,
    We have downloaded the CE 7.1 EhP1 trial version.
    Any pointers to tutorials to implement Flash Islands with Web Dynpro Java would be helpful.
    Thanks,
    Chitrali

    Hi,
      I read a document which says Adobe Flex Builder is not been included part of shipment of NW. So not lots of documents available. Yet with WDA, some tutorials and blogs are available. Similar application can be developed using WDJ. Please check these.
    WDJ:
    The specified item was not found.
    WDA:
    http://www.adobe.com/devnet/sap/
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/10989ef6-968c-2b10-50a9-eb34a5267163
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/emtech/sapRichIslandsforAdobe+Flash
    Regards,
    Harini S

  • Unknown protocol: jndi java.lang.Throwable: unknown protocol: jndi

    hi,
    i use WLI 8.1 sp6. in my application i have a JMS Queue to publish the message from first jpd and in the second JPD im reading the message using JMS EG. we have managed servers (MS1 and MS2) and 2 JMS Server. when the message is published to MS1 server its throwing the following exception
    <unknown protocol: jndi
    java.lang.Throwable: unknown protocol: jndi
    at com.bea.wlw.runtime.core.control.jmscontrol.JMSWrapper.lookupConnectionFactory(JMSWrapper.java:200)
    at com.bea.wlw.runtime.core.control.jmscontrol.JMSWrapper.getConnectionFactory(JMSWrapper.java:169)
    at com.bea.wlw.runtime.core.control.jmscontrol.JMSWrapper.ensureJNDILookupCache(JMSWrapper.java:127)
    at com.bea.wlw.runtime.core.control.jmscontrol.JMSWrapper.acquirePooledJMSConnectionAndSession(JMSWrapper.java:64)
    at com.bea.wlw.runtime.core.control.jmscontrol.JMSWrapper.getSession(JMSWrapper.java:325)
    at com.bea.wlw.runtime.core.control.jmscontrol.JMSControlMsg.createTextMsg(JMSControlMsg.java:115)
    at com.bea.wlw.runtime.core.control.jmscontrol.JMSControlMsg.createMessage(JMSControlMsg.java:72)
    at com.bea.wlw.runtime.core.control.jmscontrol.JMSControlImpl.createMessage(JMSControlImpl.jcs:1293)
    at com.bea.wlw.runtime.core.control.jmscontrol.JMSControlImpl.handleInvoke(JMSControlImpl.jcs:1279)
    at com.bea.wlw.runtime.core.control.jmscontrol.JMSControlImpl.invokeInternal(JMSControlImpl.jcs:377)
    at com.bea.wlw.runtime.core.control.jmscontrol.JMSControlImpl.invoke(JMSControlImpl.jcs:310)
    at com.bea.control.WliJMSControlImpl.invoke(WliJMSControlImpl.jcs:205)
    at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:377)
    at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:433)
    at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:406)
    at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke(JcsProxy.java:388)
    at $Proxy64.sendTextMessage(Unknown Source)
    but in MS2 its working perfectly. Any help in solving this issue would be appreciated.
    thanks,
    Anees.

    Check your java.security file
    probably in your line to set parameter login.config.url.1=files:c:/yourpath/xxx.conf you removed the "files" protocol to indicate the path.
    example
    login.config.url.1=c:/yourpath/xxx.conf
    with this you get the error
    "java.lang.SecurityException: unknown protocol: c".
    Regards,
    Alexandre Gonzalez

  • Problem instatiating factory implementation when invoking a service in java

    Hello,
    I' have the following problem: When I invoke a service from java code (it is a customized policy step implementation of a server agent), I get the following exception (some part of the error message description is german because it's a german versin of the SOA Suite, my translations are in []):
    error.build.wsdl.model: oracle.j2ee.ws.common.tools.api.WsdlValidationException: modeler error: Problem instantiating factory implementation.:
         Fehlende Klasse [missing class]: oracle.webservices.wsdl.WSDLFactoryImpl
         Abhängige Klasse [dependent class]: javax.wsdl.factory.WSDLFactory
         Loader: oracle.jwsdl:10.1.3
         Code-Source: /C:/product/10.1.3.1/OracleAS_1/webservices/lib/orawsdl.jar
         Konfiguration [Configuration]: <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar
    Diese Load wurde um oracle.wsm.agent:10.1.3.1 mit der Methode Class.forName() eingeleitet [This load was introduced/caused with/by method Class.forName() on...].
    Die fehlende Klasse ist in den folgenden Speicherorten verfügbar [The missing class is available in the following location]:
         1. Code-Source: /C:/product/10.1.3.1/OracleAS_1/webservices/lib/orawsdl.jar (from <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar)
         Diese Code-Source ist im Loader oracle.jwsdl:10.1.3 verfügbar [This source code is available in loader oracle.jwsdl:10.1.3].
    : oracle.classloader.util.AnnotatedClassNotFoundException:
         Fehlende Klasse [missing class]: oracle.webservices.wsdl.WSDLFactoryImpl
         Abhängige Klasse [dependent class]: javax.wsdl.factory.WSDLFactory
         Loader: oracle.jwsdl:10.1.3
         Code-Source: /C:/product/10.1.3.1/OracleAS_1/webservices/lib/orawsdl.jar
         Konfiguration: <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar
    Diese Load wurde um oracle.wsm.agent:10.1.3.1 mit der Methode Class.forName() eingeleitet.
    Die fehlende Klasse ist in den folgenden Speicherorten verfügbar:
         1. Code-Source: /C:/product/10.1.3.1/OracleAS_1/webservices/lib/orawsdl.jar (from <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar)
         Diese Code-Source ist im Loader oracle.jwsdl:10.1.3 verfügbar.
         at oracle.classloader.PolicyClassLoader.handleClassNotFound (PolicyClassLoader.java:2068) [C:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@10469011]
         at oracle.classloader.PolicyClassLoader.internalLoadClass (PolicyClassLoader.java:1679) [C:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@10469011]
         at oracle.classloader.PolicyClassLoader.loadClass (PolicyClassLoader.java:1635) [C:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@10469011]
         at oracle.classloader.PolicyClassLoader.loadClass (PolicyClassLoader.java:1620) [C:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@10469011]
         at java.lang.ClassLoader.loadClassInternal (ClassLoader.java:319) [jre bootstrap, by jre.bootstrap:1.5.0_06]
         at java.lang.Class.forName0 (Native method) [unknown, by unknown]
         at java.lang.Class.forName (Class.java:242) [jre bootstrap, by jre.bootstrap:1.5.0_06]
         at javax.wsdl.factory.WSDLFactory.newInstance (WSDLFactory.java:75) [C:/product/10.1.3.1/OracleAS_1/webservices/lib/orawsdl.jar (from <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oracle.jwsdl:10.1.3]
         at oracle.j2ee.ws.common.processor.modeler.wsdl.WSDLModeler.buildModel (WSDLModeler.java:137) [C:/product/10.1.3.1/OracleAS_1/webservices/lib/wsclient.jar (from <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oracle.ws.client:10.1.3]
         at oracle.j2ee.ws.common.processor.config.ModelInfo.buildModel (ModelInfo.java:167) [C:/product/10.1.3.1/OracleAS_1/webservices/lib/wsclient.jar (from <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oracle.ws.client:10.1.3]
         at oracle.j2ee.ws.client.dii.ServiceInfoBuilder.getModel (ServiceInfoBuilder.java:196)
    at ... ...
    at ... ...
    Here is the relevant part of my source code:
    import javax.xml.rpc.ServiceFactory;
    import javax.xml.rpc.Service;
    import javax.xml.rpc.Call;
    // create service
    Service service = null;
    try{
         service = factory.createService(wsdlLocation, serviceName);
    // HERE (the line above) the exception is thrown!!!!
    catch (Exception e) {
    Does anybody have an idea what the reason for this problem is and how I can fix it?
    Thank you very much,
    Stefan

    Hello,
    I had to add the information, which jar-file has to be used, into the build.xml that is used by the ant script.
    Now the missing class problem is solved, but now there is another (similar) problem:
    error.build.wsdl.model: oracle.j2ee.ws.common.tools.api.WsdlValidationException: modeler error: Problem instantiating factory implementation.: oracle.webservices.wsdl.WSDLFactoryImpl: java.lang.ClassCastException: oracle.webservices.wsdl.WSDLFactoryImpl
    at javax.wsdl.factory.WSDLFactory.newInstance(WSDLFactory.java:77)
    at oracle.j2ee.ws.common.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:137)
    at oracle.j2ee.ws.common.processor.config.ModelInfo.buildModel(ModelInfo.java:167)
    at oracle.j2ee.ws.client.dii.ServiceInfoBuilder.getModel(ServiceInfoBuilder.java:196)
    at oracle.j2ee.ws.client.dii.ServiceInfoBuilder.getModel(ServiceInfoBuilder.java:199)
    at oracle.j2ee.ws.client.dii.ServiceInfoBuilder.getModel(ServiceInfoBuilder.java:181)
    at oracle.j2ee.ws.client.dii.ServiceInfoBuilder.buildServiceInfo(ServiceInfoBuilder.java:114)
    at oracle.j2ee.ws.client.dii.ConfiguredService.<init>(ConfiguredService.java:54)
    at oracle.j2ee.ws.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:43)
    at customsteps.StefansAspektStep.invokeService(Unknown Source)
    Any ideas? Do I have to set some System properties? What is the reason for this class cast error?

  • Implementing a layer 7 Protocol

    Hi everybody
    Ive learned Java for three years at school, but I am not really an expert
    Im playing around with Java networking (a small client / server architecture) and now I want to implement a small protocol. The protocol should be modular and quite simple, but I don't know how to implement it.
    My idea up to now was to write messageobjects which implement an interface and therefore contain a method called invokeAction. When any part receives such an object, the invokeAction Method is invoked. This means that the message contains all the logic needed to do something. But then it's difficult for the message to access Server / Client components and also the messages will become very big when the logic becomes more complex.
    How can this be done in a more efficient way and how is such a protocol implemented in a real program
    Sry for my bad english ;)

    From what you describe, it sounds like you simply want to serialize an object using, for example, [ObjectOutputStream.writeObject()|http://java.sun.com/javase/6/docs/api/java/io/ObjectOutputStream.html#writeObject(java.lang.Object)].
    You'll also have to serialize any other objects and primitives used by that method and not present on the other end.
    As for efficiency, there's no point asking how to make it "more efficient" until you have specific performance requirements and specific problems where those requirements are not being met.

  • How to get RTP protocol to Java app?

    Hi,
    I need to work with RTP streams, but I've got problem that I cannot use rtp protocol - if I want to create a new url, MalformedURLexception is raised, here is sample code:
    java.net.URL url;
    try{
         url = new java.net.URL("rtp://www.someweb.cz:8080");
    catch(Exception e){
         System.out.println("Cannot create url - "+e);
    }http and ftp work fine. Can someone explain me what is wrong? JMF is installed on my system...

    MalformedURLexception is raised/*Because your URL is not of proper format*/
    //New mlr should be
    ("rtp://www.someweb.cz:8080//video//1")                    ///Becuse it's windoz //
    !("rtp://www.someweb.cz:8080)
    hmm, damn,
    i hope it works.
    kiss                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

  • Implementation of a parse tree in java (HELP!!!)

    I want to be able to do this in java, please how can i implement this.
         +
              a *
              b c

    It's not entirely clear what you want to do. That expression in infix notation (standard notation) would be "(b a c) + *" which doesn't make any sense. The leaves of the tree should be values, and non-leaf nodes should be operators. You can implement this by using a tree datatype in Java.

  • Implementation of a parse tree in Java (Urgent)

    How best can a parse tree be implemented in java, i have read some online information that suggest use of data structures, but i am still not clear on how to do it.

    Well, you need a tree. A logical way to structure a tree is out of "node" objects. A node presumeably will hold some data, and may also have one or more subnodes.
    So the root of your effort ought to go into designing the node - data it will hold, and getters and setters, and operations to walk the tree.

  • How can I implement the connection pool in my java stored procedure

    my java stored procedures (in database 'B') have to connect to another oracle database ,let's say 'A'. And how can I implement the behavior like the so-called connection pool in my java stored procedure in 'B', as below.
    1. database B, has 2 java stored procedures sp1 and sp2
    2. both sp1 and sp2 connects to databse 'A'
    whatever I call the sp1 and sp2 and the database 'A' always only one connected session from sp1 and sp2 in database 'B'.
    THANKS A LOTS...

    my problem is I have a lots of java stored procedures need to cnnect to the remote oracle db, and I hope the remote db can only have a connected session from my java stored procedures in my local db. I try as below
    class sp{
    static Connection conn=null; //the remote db connection,
    public static void sp1(){...}//procedure 1, using conn
    public static void sp2(){...}//procedure 2, using conn,too
    I can 'see' the 'conn' variable if I invoke the sp1() and sp2() from the same client application(maybe sqlplus). But if I invoke the sp1() from client 'A' and invoke sp2() from client 'B' then the sp1() and sp2() can not see the 'conn' variable for each other. I think it's because the two clients cause oracle to create two instances of the class 'sp' and the sp1() and sp2() located in different instance seperately. Thus the sp1() and sp2() can not see 'conn' for each other. They can only see its own 'conn'.
    To connect to the remote db from the java stored procedure is easy but is it possible to connect to the remote db via database link from the java stored procedure at my local db ? If so, then I also archive my goal .
    BTW , thanks a lots...
    andrew :-)

  • Default SSL Context Protocol on Java 1.4.2

    What is the default SSLContext for Java 1.4.2? Specifically, if I use the default SSLSocketFactory, the SSLContext is automatically created behind the scenes. The protocols supported on this version are:
    SSL
    SSLv3
    TLS
    TLSv1
    I am moving away from the default SSLSocketFactory, but am wanting to ensure I am using identical protocols as before.
    Thanks.

    Good question. I thought it was written down somewhere but I can't find it, so I must just put it down to experience. Also, TLS supports SSLv3 by backwards compatibility so this would be the most logical default.

  • Implementation of K-Nearest Neighbour in Java

    Please is there anyone who can take me through the process of implementing K -nearest neighbour in Java.

    You can check out R's KNN implementation and adapt it to Java.

  • Does LabView support RS232 Z-Modem Protocols?

    There is the possibility to send Files with z-modem transfer protocol via the hyper-terminal. Is it also possible to do the same thing with LabView?
    Thanks for answers.

    Hello Suttema
    I think Labview does not support zmodem directly. You will have to use a dll or an Antivex.
    The one from adontec (www.adontec.com) looks interesting. You can google for more.
    Hope it helps
    Alipio
    "Qod natura non dat, Salmantica non praestat"

  • Implementing C language TCP header using Java

    Hello,
    I am in need of implementing the following C language code under Java...
      short len;
      struct
        char trans_id[4];
        char trans_filler[46];
        char data_vector[2];
        char data_len[2];
      } tcp_hdr;
      len = 257;
      memcpy(&tcp_hdr.trans_id[0], "SURV", 4);
      memset(&tcp_hdr.trans_filler[0], NULL, sizeof(tcp_hdr.trans_filler);
      tcp_hdr.data_vector[0] = 0x00;
      tcp_hdr.data_vector[1] = 0x08;
      memcpy(&tcp.hdr.data_len[0], &len, 2);
    }The code is used to create a TCP header that is prefixed on all Socket messages sent to the host.
    I thought I would throw this out and see if anyone has any ideas on how to implement this...
    Thanks.
    -Jeff

    Hello,
    I am in need of implementing the following C language
    code under Java...
    short len;
    struct
    char trans_id[4];
    char trans_filler[46];
    char data_vector[2];
    char data_len[2];
    } tcp_hdr;
    len = 257;
    memcpy(&tcp_hdr.trans_id[0], "SURV", 4);
    memset(&tcp_hdr.trans_filler[0], NULL,
    sizeof(tcp_hdr.trans_filler);
    tcp_hdr.data_vector[0] = 0x00;
    tcp_hdr.data_vector[1] = 0x08;
    memcpy(&tcp.hdr.data_len[0], &len, 2);The code is used to create a TCP header that is
    prefixed on all Socket messages sent to the host.
    I thought I would throw this out and see if anyone
    has any ideas on how to implement this...
    Thanks.
    -JeffWhat is the problem? You can write an identical header in many different ways. One is to use DataOutputStream.
    Kaj

Maybe you are looking for