Where to keep static datafiles on AWS Elastic Beanstalk ( for a Tomcat web application)

Viewed 14

I built a web application that uses HTTP servlets to store and access text data files stored on the server and displays data ( in the form of charts ) in the HTML page. All together around 10K of small txt files 20GB total ?

The app is deployed on a Tomcat server. Everything is pretty straightforward and works perfectly when deployed locally or on a hosted Tomcat.

Now I deployed the application on the AWS Elastic Beanstalk. I deployed the .WAR file. HTML and servlets work fine. But there are no data files to show the data.

QUESTIONS:

Where on AWS should I upload my data files ? What path should I use in my HTTP servlets code to access those files on AWS?

My local folder structure:

C:
-TOMCAT ( tomcat installation folder )
-DATA_FILES
-- file1.txt
-- file2.txt

-- many text files

Fragment of the current servlets code to access the files:

homeDir = new File ( System.getProperty( "catalina.home" ) ); // equal to C:/TOMCAT
dataDirName = ( homeDir.getParent() + "/" + "DATA_FILES" );   // equal to C:/DATA_FILES

// here I access the files
File[] dataFileList;
File dataDir = new File ( dataDirName );
dataFileList = dataDir.listFiles();

// read content of the file1.txt and do whatever I need to process the data

String filecontent = readFileContent( intervalFileList[ 0 ] );

Thank you.

0 Answers
Related