My application requires extracting rar file in Google App Engine. I can extract rar file using this library but it only supports java.io.File and does not support AppEngineFile. I can not find any solution to solve this problem. Someone have any ideas ?
Thanks in advance
The junrar library says it takes an InputStream, not a file.
You may want to try uploading your rar files to BlobStore instead of reading from the filesystem. Then you can use BlobstoreInputStream to read the data into unrar.
Note that since you can't write to the filesystem, you'll need to store the unpacked data back into the blobstore or datastore.
Related
I need to build an App in Android for my colleagues and distributors to collaborate. The datasource will be an Excel file residing in our company's OneDrive or Sharepoint, for which, the users can be given access. I have been looking around but could not find a way to do this with Android/Java. Would appreciate any help I can get from the community!
You can use Apache-POI Java API for reading Excel File.
it's plain but still the best solution for that now.
However, if you just need to read the Excel, it maybe good to go with JavaScript solution. With js-xlsx library, you can transfer Excel files into JSON. And the library size is small, just 395KB (only include xlsx.core.min.js)
to connect your application with one drive , use OneDriveSdkAndroid
I currently have an Android and iOS app that downloads and reads an epub file stored in a remote server. Currently the epub is fully downloaded before being unzipped and displayed.
Now, the client requested for a way for the user to be able to read the content of the epub while the epub is being downloaded. Is there any way to accomplish this?
Thank you in advance.
No, there is no way to achieve this, if you download a (zipped) EPUB file. You can "stream" if you store the EPUB in uncompressed form on your server, and provide a suitable API for retrieving its parts as said by deathyr.
BTW, the latter is what Readium cloud reader does. See https://github.com/readium/readium-js-viewer
I'm trying to store a file into Google NearLine using a java program and Google's Cloud Storage API. But I'm having difficulty finding out how to do this.
I think I have to convert the File object into a StorageObject, but not sure how to do it.
Here's a link to the doc's for the StorageObject.
https://developers.google.com/resources/api-libraries/documentation/storage/v1beta2/java/latest/com/google/api/services/storage/model/StorageObject.html#set(java.lang.String,%20java.lang.Object)
Thanks.
Note: I've been using this link as a guide:
https://cloud.google.com/storage/docs/json_api/v1/json-api-java-samples
However, this only shows you how to access the bucket, not upload files to the bucket.
To upload files, use Storage.Objects.Insert: https://developers.google.com/resources/api-libraries/documentation/storage/v1beta2/java/latest/com/google/api/services/storage/Storage.Objects.Insert.html
I am creating a web app in google app engine using java which dynamically generate an HTML file. The requirement is such that if the Html file size increases from a certain limit (say 3 mb), then it should be split into two files and zipped together and that zip file should be sent back as the response.
I would like help on how and where to create those temporary HTML files and then zip it, in google app engine as i guess GAE doesnt allow to write on the filesystem.
Please help!!!
You can use the blobstore like a filesystem. Experimentally, they've even added access via the File api!
https://developers.google.com/appengine/docs/java/blobstore/overview#Writing_Files_to_the_Blobstore
You could also use the Google Cloud Storage. The advantage of this one is that once the file is produced, you can easily write scripts to manipulate the files through gsutil.
I have followed the sample code below to upload a zip file in the blobstore. I am able to upload the zip file in but i have some concerns reading the file.
Sample Code http://code.google.com/appengine/docs/python/blobstore/overview.html#Complete_Sample_App
My zip file has 6 CSV files where my system will read the files and import the values in the datastore. However i am aware that there are some restrictions to read the file which must be less than 1MB.
Can anyone suggest how i can go about reading the zip file and process the CSV file? What will happen if my data saved in the blobstore is more than 1MB?
Hope to hear from you. Advance thank.
Individual API calls to the blobstore API must be less than 1MB, but you can read as much data as you want with multiple calls. See this blog post for an example of using BlobReader to read the contents of a zip file from the blobstore; it's written using Python, but BlobReader is available in the Java SDK too, and the same technique applies.