0

I am working on Google app engine file uploading to Google cloud storage using java. I have uploaded a apk file in Google cloud storage using BlobService java API. And can also able to get the uploaded file. Before the uploaded file get into the cloud storage, i need to check the file whether all the files are existed or not. That part also over, now its time to work with the AndroidManifest.xml file. I have successfully read the AndroidManifest.xml file, but that file is not in the plain text, it is in the binary format. I have read the file and keep all the data of the file into a string. Now i just want to bring that string into user readable format. Is there any API to make the string into readable? Any help would be appreciated.

And my code for to read the file is

BlobInfoFactory blobInfoFactory = new BlobInfoFactory();
InputStream inputStream = new BlobstoreInputStream(blobKeys.get(0));
ZipInputStream zis = new ZipInputStream(inputStream);
ZipEntry entry;
while ((entry = zis.getNextEntry()) != null&& entry.getName().endsWith("AndroidManifest.xml")) {
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    int read = 0;
    while( ( read = zis.read() ) != - 1 ) {
     output.write( read );
    }
    String s=output.toString();  
    System.out.println(s);
    output.close();
     break;
    }
   zis.close();
  inputStream.close();

in the above code string s contains the AndroidManifest.xml file data in unreadable format.

cweiske
  • 30,033
  • 14
  • 133
  • 194
Sreekanth
  • 534
  • 1
  • 5
  • 21

0 Answers0