Return-Path: X-Original-To: apmail-abdera-dev-archive@www.apache.org Delivered-To: apmail-abdera-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9D986955D for ; Fri, 4 Nov 2011 02:25:56 +0000 (UTC) Received: (qmail 11299 invoked by uid 500); 4 Nov 2011 02:25:56 -0000 Delivered-To: apmail-abdera-dev-archive@abdera.apache.org Received: (qmail 11255 invoked by uid 500); 4 Nov 2011 02:25:56 -0000 Mailing-List: contact dev-help@abdera.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@abdera.apache.org Delivered-To: mailing list dev@abdera.apache.org Received: (qmail 11074 invoked by uid 99); 4 Nov 2011 02:25:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Nov 2011 02:25:56 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Nov 2011 02:25:53 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id CF74F33159D for ; Fri, 4 Nov 2011 02:25:32 +0000 (UTC) Date: Fri, 4 Nov 2011 02:25:32 +0000 (UTC) From: "liuyanyan (Commented) (JIRA)" To: dev@abdera.apache.org Message-ID: <1831305143.58156.1320373532851.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <646774801.55107.1320315572241.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (ABDERA-292) unreadable text after upload a XXX.txe file MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/ABDERA-292?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13143695#comment-13143695 ] liuyanyan commented on ABDERA-292: ---------------------------------- Upload picture is ok. But unreadable codes after upload a *.txt file. The size is 2 byte, but it will be 4byte after uploaded. Can anyone can help me? Thank you in advance! > unreadable text after upload a XXX.txe file > ------------------------------------------- > > Key: ABDERA-292 > URL: https://issues.apache.org/jira/browse/ABDERA-292 > Project: Abdera > Issue Type: Bug > Affects Versions: 0.3.0, 0.4.0 > Reporter: liuyanyan > > private AlfrescoResponse uploadFile(FileInputStream inputStream, String fileName, String description, String mimeType, String destinationFolder) { > // Build the input Atom Entry > Abdera abdera = new Abdera(); > Entry entry = abdera.newEntry(); > entry.setTitle(fileName); > entry.setSummary(description); > entry.setContent(inputStream, mimeType); > ExtensibleElement objElement = (ExtensibleElement) entry.addExtension(NS_CMIS_CORE, "object", CMIS); > ExtensibleElement propsElement = objElement.addExtension(NS_CMIS_CORE, "properties", CMIS); > ExtensibleElement stringElement = propsElement.addExtension(NS_CMIS_CORE, "propertyId", CMIS); > stringElement.setAttributeValue("cmis:name", "ObjectTypeId"); > Element valueElement = stringElement.addExtension(NS_CMIS_CORE, "value", CMIS); > valueElement.setText("document"); // This could be changed as an input parameter > AbderaClient client = new AbderaClient(); > // Authentication header > String encodedCredential = Base64Coder.encodeString((username + ":" + password)); > RequestOptions options = new RequestOptions(); > options.setHeader("Authorization", "Basic " + encodedCredential); > > String uri = server + "/alfresco/s/cmis/p" + destinationFolder + "/children"; > if (LOGGER.isLoggable(Level.INFO)) { > LOGGER.info("POST " + uri); > } > ClientResponse clientResponse = client.post(uri, entry, options); > AlfrescoResponse alfResponse = parseResponseWithDocument(clientResponse); > clientResponse.release(); > return alfResponse; > } -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira