How to change the file upload folder in apache tomcat? - file

Tomcat 6.29 creates a folder under temp folder in apache tomcat, and when I uploaded a file with the path req.getSession().getServletContext() + specified folder but when the application is redeployed another application folder is again created so the previously uploaded files stay at the older deployed application. I want to upload files under webapp folder/app_name but at that time I take the specified doesn't exist. I wonder if it is possible to upload and retrieve the files under the webapp/app_name.
Note: application is developed with spring+hibernate and deployed with maven.

Yes. Just use a relative path in your file handler code. Go up with ../../.. etc. Or you can make a direct server request against the old app from within your handler - servlet to servlet, for example.

Related

How do I access my system code that is in the app engine through the cloud shell?

I have a system on App Engine, but I need to upload an HTML file in the code. How do I access my system folder through Cloud Shell and upload the HTML file?
You can not upload a single file to Google App Engine. When you deploy to GAE, the process syncs your local files (working directory) with the remote files (remote directory). All changes made on the working directory will be reflected on the remote directory after deployment.
As marian suggest you will need to try deploying your application again including all the files you want to be uploaded(such the html file you mentioned).
You can check this document [1]
[1] https://cloud.google.com/code/docs/intellij/deploy-flex

easing the gradle build process in deploying spring boot and angular js application

I am working on gradle based spring boot and angularjs project. I have all my angularjs code in static folder which is committed to Git. We need to deploy it into a server which does not have access to internet. So I have generated dist contents using gulp serve:dist and replaced the contents in the static folder with the contents of dist folder. Then I have generated jar file and deployed in server.
So it is becoming manually cumbersome every time to replace the contents of static folder with the contents of dist generating jar file then removing the dist folder contents from static folder and then replacing it with original angular js code.
Is there any possibility to generate the jar file directly using the contents from dist folder instead using the contents in static folder?
I am not sure whether I made the problem clear or not. Please update me if you need any further clarification.
If you are using Spring Boot with standalone JAR deployment, you just need to output front-end assets into src/main/resources/static and Spring Boot will serve them via embedded container.
You can use Gradle Gulp Plugin to execute Gulp build as task within main Gradle build.
Reaction on comment:
Mentioned static folder of course contains only assets you intend to serve by Spring Boot. It wouldn't contain code or anything else. You can have your code in e.g. [projectRoot]/jsSrc. Just Gulp needs to know where to find these files.
We are using such directory structure without any problems (with CI build running on every commit). If manual action is needed to build project, your build is fundamentally broken. In this case your issue is misplaced JS source files.

Google chrome app writing files to the app folder

https://developer.chrome.com/extensions/xhr documents access to
a file in the source code by a user of an installed chrome app.
ie xhr.open("GET", chrome.extension.getURL('/config_resources/config.json')
It works for the app I'm developing.
Where is the root folder for such "local" urls?
Can a user of my chrome app save a file to this folder? How?
The extension folder is not writable or accessible to the user. If it is acceptable for the files to be not accessible outside your app, you can write files using the sandboxed filesystem api.
You can also access the files in your package using fetch or
chrome.runtime.getPackageDirectoryEntry

Spring Boot IntelliJ Make Project not working for static files

I have a Spring Boot (1.3.5.RELEASE) project in IntelliJ 15.
My web application is AngularJS based. If I edit a html file in the src/resources/static folder and press CTRL+F9 (Make Project) the updates are not synchroizied to the target folder of the project. Why is intellJ deleting the files during "make project"?
What is an easy way to sync the src/static folder with the target dir?

uploading files to local server into a "safe folder" with meteor

I've managed to make a file uploader to the local server, with Meteor.
-.meteor
-local
-build
-db
-static
Ive write the files to the static folder, and everything goes fine, but whenever I restart the server, end build a new app, the local folder gets deleted along with my static folder.
Is there a safe place for files, which does not bundle with the app?
I've tried to write outside the local folder, just next to it, but when I deploy that version, the app wont start at all on the meteor server.
So where am I suppose to create a "safe folder" neither being bundled on deploy, nor deleted on restart, and still accessible apps deployed to the meteor server?
thanks in advance!
That depends on where and how you deploy the application. If you're using a vps or similar solution that gives you access to the file system, you can:
Write outside of the project directory, in a completely unrelated place.
Write in a hidden directory inside the project dir. So, next to .meteor, but only inside another folder that begins with a . (like .uploads).
Whether or not this will work may depend on your platform.

Resources