Any way to get the file path to the source file of an embedded resource at runtime? - embedded-resource

I am working on a VirtualPathProvider which will let me load embedded resources (ER) (such as .js or .css files) from a referenced assembly. I would like to be able to change the .js files and .css files at runtime and have the changes reflected without having to refresh the whole page. I can do this if I have the path to the resource file as I can use that as the source instead of the ER.
Is there any way to extract the source code location of an assemblies csproj or an embedded resource at runtime, perhaps from the .pdb file, and if so, how would I do it in c#? Thanks!

Related

How can I write to a file which shall be bundled with my application, if I cannot write into a file in resources folder (Eclipse)?

My application shall be packaged (shall be a jar distributed with) a file, which initially contains data. Then application appends this file. I attached this file as a resource (I created a resource folder in elipse and made it a source folder), but now I understand it is read-only! There was such question in [SO].
So how can I distribute a file with my application and append this file as my application works? What is a best way for that? This is a plain txt file.

Install4j: Get the absolute path of the project file

I have the installer project with all the resources it uses added in my Gradle project (in path project_folder_path/install). But for some sql operations (which will run during the installation), I need to add some files located in other modules of my gradle project (for example in path project_folder_path/sql) to its distribution tree. So, is there any way to somehow get the file path of the .install4j file( or is there any variable existing) that I can manipulate later for finding the files required?
Relative files are resolve relatively to the .install4j project file. So you don't need a variable for that location, just add relative paths to the distribution tree.

Flash builder doesn't create swf file in custom output folder

I am trying to build my flex project to a custom output folder.
I am running Flash Builder on windows and I have set the output folder to a custom location.
When I build the project, the SWF file in not generated in the output folder. Instead, I get the folders of my package (e.g. my.package.name generates folder structure my/package/name) and the SWF file in generated in the inner directory.
I know this shouldn't be happening (FB should be generating a SWF file directly under the custom output folder) but can't figure out why it's not working.
Please check in your source code. I think you are using my.package.name in ActionScript class or in <fx:Script> tag. Therefore compiled output is creating directory according to package name.

How to Copy Files on War Start

I have a number for Word Docs and PDFs that need to be copied to a file storage on start of my Grails app.
I figured I can just leverage BootStrap.groovy to check for existing files then copy if none found. However, I don't know the best practice of including the files into the WAR file.
How can I copy these files?
I don't know if it is a best practice, however we have all our external files into web-app directory. i.e. We have directories reports and pdf besides css and images directories. All that files are package and deploy into war file.

how to create Eclipse virtual file resource

Is there any method to create a virtual file resource in eclipse?
By my definition, such a resource would appear (for Eclipse) to reside at a certain location within the Eclipse project's workspace, but is actually stored somewhere else.
My overall goal is to resolve xml schema documents from project dependencies (jar imports) based on their relative import location. I can accomplish this goal, but now I need a way to make those resolved documents visible in the project folder (within the Eclipse project) relative to the document that imported them without actually writing them to the source folder (they shouldn't be checked-in to source control).
The goal is to allow xml documents to resolve properly in the various eclipse editors, while allowing some of the referenced documents (XSDs and the like) to reside within archives on the project's classpath (or anywhere else such that they're referenced by the project, really).
My initial plan of attack is to create a custom builder plugin which would resolve such documents into virtual resources as the build path was changed. (assuming that such a "virtual file resource" is something that can be created).
Any help is appreciated.
IPath location = new Path(name);
IFile file = project.getFile(location.lastSegment());
file.createLink(location, IResource.NONE, null);
seems to be the way to do it;
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2FresInt_virtual.htm