Search code examples
tomcatjcifsshared-directory

How to access shared folder from spring


This might look like as a question which show poor searching but the truth is that despite my googling I have not found a direction yet.

The context

I am developing a web player using tomcat and spring mvc. At this point of time I have deveoped the jsp page which search the audio calls locally(On my PC). However, my plan is to retrieve my audio calls from a windows shared folder. As you might have understood at the moment I keep all my audio files in a local folder on my desktop.
I need to store million of files and the amount of data expected is around 200 TB.

My objective

My aims are to store all calls on a windows shared folder which I can access from spring somehow and to secure the audio data to make sure it can be played only with my audio player

FYI

The database at the moment keep the metadata of the relative audio paths. The audio files are in opus format and should be played in a html5 audio tag.

Summary:

  1. Which is the best technology to achieve this?
  2. Is a windows shared folder the best solution?
  3. Do you know how can I secure the audio data? Encrypt it in the shared folder to increase security and make sure it can be played only from my application?
  4. How can I connect to a external shared folder using spring? Is JCIFS a good solution. Apache Camel?
  5. How can I dynamically add the path of the the shared folder to each audio files

Hope this is not a too broad question which is against stack-overflow rules. Simply a need a direction not a full answer to each of the bullet points above


Solution

  • First and foremost: This question is not related to Java or the Spring-framework.

    Short answer: Just use a configurable path and the builtin tools for your operating system.

    To answer your questions: 1.) Cannot be answered easily without detailed knowledge of number of files, network, hdd sizes and performance, raid level, and many more unknown factors. Bonus answer: using common of the shelf hardware you will be fine for simple mp3 streaming.

    2.) Well perhaps not, see 1). But then again, it is most probably good enough.

    3.) Short answer: Keep you systems safe. As long as your network, your building and your servers are safe, your data is safe.

    4.) Use the operating system tools (a CIFS mount for Linux, an Network folder mount on Windows)

    5.) Set it as a parameter in your application.