Configuring a .Properties file in Google App Engine - java

I have tried to use a Properties file with Google App Engine. I can read a Properties file with Google App Engine. But i can't write to a Properties file because FileOutputStream is not supported by Google App Engine's Java runtime environment.
Is there any way to write data to a Properties file with Google App Engine ? or any other way to read and write some texts to a file without using datastore ?

Writing data to a file is not supported on App Engine. If you are looking at reading files, then you could ship them with your application or better still in your WEB-INF* folder, so that they are not directly accessible.
If what you are trying to do is just model the properties then do look at the Datastore to model a Property entity. That generic piece of reading/writing properties from a Datastore could help you in other projects too.
In case you want to read/write files, you do have the option of Google Cloud Storage or a Google Drive, the APIs of which are accessible from Google App Engine application but I believe that might be a bit of overkill for what you want. But you do have that option too.

Related

Saving and dowloading files with java (HomeMade Cloud)

Hello :) I'm here because i want to create my own cloud server using Java Spring. In this cloud i want to save files like .docx, .mp4, .exe saving them on a HDD. (Later i want to run this server on a Raspberry). I want to be able to open and download this files on any type of device and from anywhere
For that i gonna user Java 1.8 with Spring for the backend.
So my answer is : which framework can i use to do that, to save my files on a HDD and download this files on my device from this same hdd ? i know for example with NodeJs there is express-fileupload. There is something similar in java ?
Thank you ! :)
For you use case just use drive, don't reinvent the wheel - google cloud, dropbox, s3, etc.
Also, it's not correct to say that you want to "create your own cloud" - you just want to create a storage system.

Parsing text from PDF file in application hosted in Google App Engine

I am working on uploading a PDF file (available in machine locally/in Google Drive), saving it and then parsing the text from it. This text will then be used in writing to a word doc.
These functionality are working in my locally hosted application. However, after I deployed it in Google App Engine, I am no more able to parse a PDF file.
How can I read a PDF file in a Java application hosted in Google App Engine.
In Tomcat parser -
new PDFParser(new RandomAccessFile(file,"r")); //allow to read and parse pdf
In GAE-
new PDFParser(new RandomAccessFile(file,"r")); //throwing access denied..
Programs running in Google App Engine may not do everything that a program on a local work station can. E.g. there obviously is no normal GUI which can be a hindrance to code using AWT, even if only to create an image file or interpreting font information!
Thus, programs and libraries not developed with GAE in mind may fail when deployed to GAE.
Some libraries have special versions for use with GAE, e.g. for iText there is iTextG.
As there are similar restrictions on Android, switching to an Android version of one's library may also help.
As a bottom line, when developing for GAE you have to check whether your libraries are compatible with GAE. If they aren't, you have to switch, either to GAE (or Android) versions of them or other libraries altogether.

get uploaded file path in java web application

Since from the 4 days i have been trying to find out the path for the uploaded file. I think it wont possible. Can any one tell me how to get the uploaded file path in java web application. Is there any external API to get the uploaded file path? And my project is google app engine type project. Please some one answer it.
As you can't write to the file system it's likely you can't do whatever it is you are trying to do. So you need to use one of the storage options available instead, likely GCS.
https://developers.google.com/appengine/docs/java/googlecloudstorageclient/
Google Cloud Storage is useful for storing and serving large files.
Additionally, Cloud Storage offers the use of access control lists
(ACLs), and the ability to resume upload operations if they're
interrupted, and many other features. (The GCS client library makes
use of this resume capability automatically for your app, providing
you with a robust way to stream data into GCS.)

Dynamically generating files and providing those files for download in Google App engine

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.

Custom password encrypted file system for storing files in Android

is it possible to create a custom file system or use an existing file system like EncFs to read data inside Android environment.
My idea is to make a virtual filesystem for storing some media files and developing an app which can directly access those files from the filesystem volume.
I hope im clear with my question.!!
Yes, but you need a rooted devices to use it. Or, you need to build your own firmware. Here's one, it's open source: http://nemesis2.qx.net/pages/LUKSManager

Categories