Reading Properties of all Files existing in one of the folders on Application Server and print on a JSP - file

I have to read the Name and Creation Date/Last Modified Date of all the files that may exist on /product/xyz folder, existing on JBoss Application Server and print the same on JSP.
This folder is being loaded with the fresh files when server is booted. The framework used is Struts 1.2.
Any hints or examples around how to read these information and print on JSP? Thanks!
EDIT :
I understand that it is much easy to read the files from a folder which might be part of my workspace folder. But, this is a different scenario.
Here, the JSP file will be deployed on JBoss application server, in some ABC folder, as part of some EARs. On the same application server, there is some other XYZ location, which will be loaded with the fresh files, when server is booted. I want to read the files existing in that XYZ folder. I Hope the scenario is more clear now.

The code doesn't change whether I try to access the files from my Work Space folders (Rather, which are to be part of EARs) or I may access from the Server File System (Outside the EARs).
The issue could be there in Path Mentioned or the Permission (Read/Write) to the Folder from which the files are being read.

Related

Is .Alp file enough to run model on other device

I'm currently not having the option to check this question since I do not have 2 computers running Anylogic.
My question is if you share your anylogic .Alp file with somebody, is he able to open the model.
Or should you also need to share the things in your model file when you save it(3d map, databasemap and pictures)
Or do you even need more since when you save an anylogic file you also need to name the Java package.
I'm asking this because my computer is running on his end and I need to know what I've to put in the cloud when my computer will crash and will not be able to use it.
Im currently have put the map from the model map in the cloud and the database excel files. (But no file about the Java package cause I could not find it)
You only need the .alp file itself and all items that are in the model folder where the .alp sits. This can include:
images
database subfolder
lib subfolder (holding any required jar files)
logs subfolder
outputs subfolder
So if you simply zip the entire model folder and send it over, the other person unzips it AND IF he/she uses the same AnyLogic version, all will work.
If it is an older version of AnyLogic on the other end, it may not work (but also it may, it depends on the version difference).
Also, if you created the model with the Professional version and you used some elements that are not accessible in the free PLE version and if the other person only uses the PLE, it will also not work.
If you really just need the other person to run the model, consider compiling it or using the AnyLogic cloud.

AEM CQ5 Move option for a file to another location

I have Website configured in CQ5 AEM. I am trying to move some files to a folder on the same location. I have large count of files, each and every i should select and click on move to move files.
Any suggestion to move multiple files to a folder in the same location in adobe experience manager. In spent 1 day to send 150 files to a folder. I have almost 10000 files to move. Please suggest me to reduce my work.
I got some reference
http://docs.adobe.com/content/docs/en/cq/5-6-1/wcm/page_create_edit.html
but it is showing for 1 single file using move option.
Appreciate and Thanks in advance. It helps me alot.
If it is really about files, then you can try to connect to cq instance via WebDav and operate with files like in any file manager (but it does not work for me with pages and some other node types).
Otherwise, I would suggest to create package in package manager with all files (you want to move), download it, unzip, move required files to another folder, pack it back to package, upload and install. After that you can delete files in old location.
In second case, you, probably, will have to modify filter.xml according to new files' location.

Dart: Accessing a resource out side the project|web/ directory

I have a web-app(browser based) which needs to access a folder full of icons that resides outside the web folder.
This folder MUST be outside the web folder, and would ideally exist outside the project folder all together
however, when specifying the path to the folder neither "../" or making use of a symlink will work
when the page attempts to load the image I always get
"[web] GET /Project|web/icons/img.png => Could not find asset Project|web/icons/img.png."
however I set the image source to "../icons/img.png"
how can i get dart to access this file properly
PS: I attempted a symlink to another part of the filesystem (where the images would be kept ideally) however this did not work either.
The web server integrated into DartEditor or pub serve only serves directories that are added as folders to the files view. When you add the folder to DartEditor you should be able to access the files. This is just for development.
You have also to find a solution for when you deploy your server app. It would be a hazardous security issue when you could access files outside the project directory. Where should the server draw the line? If this would be possible your entire server would be accessible to the world.
Like #Robert asked, I also have a hard time imaging why the files must not be in the project folder.
If you want to reuse the icons/images between different projects you could create a resource package that contains only those images and add them as a dependency to your project.
If you want a better answer you need to provide more information about your requirements.
If you wrote your own server (by using the HttpServer class) it may be possible to use the VirtualDirectory to server your external files.
Looking at look the dartiverse_search example may give you some ideas.
You could put them in the lib directory and refer to them via /packages/Project/...
Or in another package, in which case they would be in a different place in the file system. But as other people have said, your requirement seems odd.

Can't copy Umbrao.sdf from webserver

I have an Umbraco application running on a webserver and I need to move the application to another webserver. The Umbraco application uses an embedded database (SQL CE 4). I can copy all the files in the application except the "Umbraco.sdf" file.
Add file named (if you like you can insert HTML that will be your maintenance page)
app_offline.html
After that IIS will release Umbraco.sdf and web.config copy and delete/rename mentioned file.
As the Umbraco installation will be using the Umbraco.sdf database, you need to turn the application into maintenance mode, by adding a app_offline.htm to the root of the webserver.
You need to make sure it is a .htm-file, i.e. not .html, cause otherwise it won't work.
Also - make a change in your web.config file, to restart the application pool, so that it may notice the change in your site.
Doing so, will release the Umbraco.sdf file, and make it possible for you to download it via simple FTP.
I just had the same issue and didn't want to stop the site to release the lock on the file, so I did the following:
RDP onto the server, make a copy of the file in the /app_data directory (call it something like "Umbraco-copy.sdf")
Download "Umbraco-copy.sdf"
Rename "Umbraco-copy.sdf" back to "Umbraco.sdf"
Perhaps, this error related to permission. You must login as a root (administrator)!

How to populate Isolated Storage for Windows Phone application

Is there a recommended way to initialize the data in Isolated Storage for Windows Phone 7 application before it is run for the first time? Right now the best solution I can think of is putting a flag in IsolatedStorageSettings and checking for its presence on in the application Launching event. If the flag is not present I initialize several objects in code and save them to Isolated Storage and set the flag so they are not set the next time the application is run. Is there a better way to do this? Should I add the objects in serialized state as some kind of resource or it is acceptable to initialize them in code? I expect that they would require like a thousand lines of code.
Well if you can create your files and add them to the project. And if you are sure that you will not be editing your files than just keep them like that. The files will go into your installation folder.
Or if you think that you are going to edit them and want to keep the changes saved, than copy them from the installation folder to the application storage folder.
Here is a link in which a database which was added as a reference to the project is copied from installation folder to storage folder of the app.
http://msdn.microsoft.com/en-us/library/hh286411(v=vs.92).aspx
Do the same for your files and everything will be fine.
The second part of your question. Well after this just check for one file/folder in the app storage folder and if it says yes it is there than do not copy your files from installation folder to application storage folder.
And if you are trying to make the files when the application launches than just add a check before the creation code is run. Where you will search for a file/folder existence. And if it exists do not run the file creation code.

Resources