Examples of FileSerializer


Examples of com.ibm.sbt.services.client.connections.files.serializer.FileSerializer

    }
   
    @Test
    public void testFileSerializer() throws ClientServicesException {
        File f = new FileService().getPinnedFiles().get(0).load();
        String p = new FileSerializer(f).generateFileUpdatePayload();
        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><entry xmlns=\"http://www.w3.org/2005/Atom\">\r\n   <title type=\"text\">LabelUpdateFileNew1395998842907</title>\r\n   <id>urn:lsid:ibm.com:td:8f6b6cca-b62f-43ba-b4cd-25d2c692072f</id>\r\n   <summary type=\"text\">SummaryNew1395998842907</summary>\r\n   <uuid xmlns=\"urn:ibm.com/td\">8f6b6cca-b62f-43ba-b4cd-25d2c692072f</uuid>\r\n   <label xmlns=\"urn:ibm.com/td\">LabelUpdateFileNew1395998842907</label>\r\n   <category xmlns=\"urn:ibm.com/td\" label=\"document\" scheme=\"tag:ibm.com,2006:td/type\" term=\"document\"/>\r\n   <category term=\"tag_word\">document</category>\r\n   <visibility xmlns=\"urn:ibm.com/td\">public</visibility>\r\n   <modified xmlns=\"urn:ibm.com/td\">2014-03-28T06:03:46.000Z</modified>\r\n</entry>",p);
    }
View Full Code Here

Examples of com.ibm.sbt.services.client.connections.files.serializer.FileSerializer

    }
   
    @Test
    public void testFolderSerializer() throws ClientServicesException {
        File f = new FileService().getPublicFolders(null).get(0).load();
        String p = new FileSerializer(f).generateFileUpdatePayload();
        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><entry xmlns=\"http://www.w3.org/2005/Atom\">\r\n   <title type=\"text\">Bill folder</title>\r\n   <id>urn:lsid:ibm.com:td:4560338f-3cb0-456a-9fac-68c2da5c8e8e</id>\r\n   <uuid xmlns=\"urn:ibm.com/td\">4560338f-3cb0-456a-9fac-68c2da5c8e8e</uuid>\r\n   <label xmlns=\"urn:ibm.com/td\">Bill folder</label>\r\n   <category xmlns=\"urn:ibm.com/td\" label=\"collection\" scheme=\"tag:ibm.com,2006:td/type\" term=\"collection\"/>\r\n   <category term=\"tag_word\">collection</category>\r\n   <visibility xmlns=\"urn:ibm.com/td\">public</visibility>\r\n   <modified xmlns=\"urn:ibm.com/td\">2014-05-08T16:22:08.000Z</modified>\r\n</entry>",p);
    }
View Full Code Here

Examples of com.ibm.sbt.services.client.connections.files.serializer.FileSerializer

            throws ClientServicesException {
        String accessType = AccessType.AUTHENTICATED.getText();
        if (file==null) {
            throw new ClientServicesException(null, Messages.Invalid_File);
        }
        String payload = new FileSerializer(file).generateFileUpdatePayload();
        String requestUri = FileUrls.MYUSERLIBRARY_DOCUMENT_ENTRY.format(this,
                FileUrlParts.accessType.get(accessType), FileUrlParts.fileId.get(file.getFileId()));
        Response response = updateData(requestUri, params, new ClientService.ContentString(
                payload, CommonConstants.APPLICATION_ATOM_XML), null);
        checkResponseCode(response, HTTPCode.OK);
View Full Code Here

Examples of com.ibm.sbt.services.client.connections.files.serializer.FileSerializer

    public File createFolder(File folder)
            throws ClientServicesException {
        String accessType = AccessType.AUTHENTICATED.getText();

        String requestUri = FileUrls.COLLECTIONS_FEED.format(this, FileUrlParts.accessType.get(accessType));
        String payload = new FileSerializer(folder).generateFileUpdatePayload();

        Response response = createData(requestUri, null, new ClientService.ContentString(payload,
                CommonConstants.APPLICATION_ATOM_XML));
        checkResponseCode(response, HTTPCode.CREATED);
        File r = getFileFeedHandler().createEntity(response);
View Full Code Here

Examples of com.ibm.sbt.services.client.connections.files.serializer.FileSerializer

     */
    public File updateFolder(File folder) throws ClientServicesException{
        String accessType = AccessType.AUTHENTICATED.getText();
        String requestUri = FileUrls.COLLECTION_ENTRY.format(this, FileUrlParts.accessType.get(accessType),
                FileUrlParts.folderId.get(folder.getFileId()));
        String payload = new FileSerializer(folder).generateFileUpdatePayload();
        Map<String, String> headers = new HashMap<String, String>();
        headers.put(Headers.ContentType, Headers.ATOM);

        Response response = updateData(requestUri, null, headers, payload, null);
        checkResponseCode(response, HTTPCode.OK);
View Full Code Here

Examples of com.ibm.sbt.services.client.connections.files.serializer.FileSerializer

        }
        String accessType = AccessType.AUTHENTICATED.getText();
        String requestUri = FileUrls.COMMUNITY_FILE_METADATA.format(this,
                FileUrlParts.accessType.get(accessType), FileUrlParts.communityLibraryId.get(communityLibraryId),
                FileUrlParts.fileId.get(fileEntry.getFileId()));
        String updateFilePayload = new FileSerializer(fileEntry).generateFileUpdatePayload();
       
        Response result = updateData(requestUri, params, new ClientService.ContentString(
                updateFilePayload, "application/atom+xml"), null);
        File r = getFileFeedHandler().createEntity(result);
        fileEntry.clearFieldsMap();
View Full Code Here

Examples of com.ibm.sbt.services.client.connections.files.serializer.FileSerializer

        String requestUri = getModerationUri(file.getFileId(), Categories.REVIEW.get(),
                ModerationContentTypes.DOCUMENTS.get());

        HashMap<String, String> headers = new HashMap<String, String>();
        headers.put(Headers.ContentType, Headers.ATOM);
        String payload = new FileSerializer(file).generateFileUpdatePayload();
        updateData(requestUri, null, headers, payload, null);
    }
View Full Code Here

Examples of simtools.util.FileSerializer

    return new File(url.getFile());
  }
 
  public static void main(String[] args){
   
    TestFileSerializer t=new TestFileSerializer(new FileSerializer());
   
    File refFile=getFile(ImageSerializer.class);
   
    ByteArrayOutputStream bo=new ByteArrayOutputStream();
    ObjectOutputStream oo;
View Full Code Here

Examples of simtools.util.FileSerializer

    /**
     * Universe serialization helper
     */
    public Universe readUniverse(ObjectInputStream in) throws IOException {
        FileSerializer fs = new FileSerializer();
        File res;
        try {
            res = fs.read(in, CurrentPathProvider.currentPathProvider
                    .getCurrentPath());
        } catch (ClassNotFoundException e) {
            throw new IOException(e.getMessage());
        }
        Universe u = getUniverse(res);
View Full Code Here

Examples of simtools.util.FileSerializer

     * Universe serialization helper
     */
    public void writeUniverse(ObjectOutputStream out, Universe u)
            throws IOException {
        saveUniverse(u, JSynoptic.gui.getOwner());
        FileSerializer fs = new FileSerializer();
        fs.write(out, u.getFile(), CurrentPathProvider.currentPathProvider
                .getCurrentPath());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.