How to read System.Net.Mail.Attachment.ContentStream properties? - vb.net

I'm looking for a way to read the Name property of the .NET Attachment.Content Stream I can see the property when I setup a watch, but when I try accessing I don't see the "Name" property show up. I need to get the file location with the "C:\Test123.pdf", I've found a way to get the file name...but I need its location/path.

Related

Mulesoft Parse Template - change location dynamically

Is it possible to replace the location property of the Parse Template? Instead of hardcoding in the location like so
Is it possible to replace this with a variable value that points to a path at runtime?
i have tried replacing the location with a variable but the project then fails to deploy because it cannot find that path. When the POST request comes in it states what file it wants parsed. Then we would ideally like to tell the parse template to go fetch that file but thus far i cant see anything that could help me online
Any suggestions would be very helpfull
I don't think it is possible to use an expression in the location attribute. Note that in the screenshot we can see that it is missing the Fx button to switch to expression mode, like the the Target Value attribute has.

File attributes slow

Using vb.net I download files using sftp then immediately set their attributes to normal.
File.SetAttributes(Downloadedfile, Attr)
where Attr is a FileAttribute. I later set the attributes to readonly
File.SetAttributes(Downloadedfile, FileAttributes.ReadOnly)
The problem I am having is that there appears to be a delay between the file being downloaded and the attributes being set by the OS(Win7). As a result the .normal attribute doesn't always get set but later the readonly attribute does. Is it possible to wait until the OS has finished whatever it is doing? I've looked around and seen various articles about changing the indexing and what the folder will be used to store but none of these suggestions has worked. Don't expect somebody to come up with "You need to this" but a pointer in the right direction would be a great help.

Save the modified Property file inside WAR deployed on server

We are trying to use Apache PropertiesConfiguration in our project using JSF and JBoss.
My property file is located inside a package say demo.prop by the name of Prop1.prop
Inside my WAR file the same is present under /WEB-INF/classes/demo/prop/Prop1.prop
Using
FacesContext.getCurrentInstance().getExternalContext().getResource("/WEB-INF/classes/demo/prop/Prop1.prop");
I am able to fetch the property file. So when I try to extract a string from the property file using
PropertiesConfiguration pc1=new PropertiesConfiguration(a);
String s1=(String)pc1.getProperty("User_Name");
I am able to get the proper string. Using set property method I am able to set the property also.
pc1.setProperty("User_Name", "hardcodedString");
But I am not able to save the FILE back to this location. No matter what I do it is not able to save the file using pc1.save.
Can anyone please try to tell me how can I save this file back to its original location so that the changes done in the property file remain as it is.
Modifying the WAR file is a bad idea (for example, some web servers may notice the file
modification an redeploy your app, there may be problems when the server explodes the war on deployment etc.)
I would suggest applying an alternative approach - some possibilities are:
Place the properties in a database table, so they can be easily modified
Use an external properties file for overriding your "Prop1.prop" file settings. You can pull this off for example as follows. Assume that the default property values are bundled in your WAR and the modified values are saved to some other path, which is defined using a system property - let say it's called CONFIG_LOCATION. Now after loading your properties from the bundle you read them also from this external "overrides.prop" file - this overrides your defaults from "Prop1.prop":
PropertiesConfiguration pc1=new PropertiesConfiguration(a);
try(FileReader propReader = new FileReader(System.getenv().get("CONFIG_FILES") +"/overrides.prop"){
pc1.load(propReader);
}
When you need to save changes, you do that to "overrides.prop" - this will save all
the properties, not only the changed ones, but that should have no negative effects.

Getting a handle to dojo's uploader filelist

We are using dojo's dojox.form.uploader.FileList in our application to show the progress of file upload. But it shows the name of the file, type extension by default. We could not see any settings to hide it or getting a handle to that. Is it possible to get a handle to that object which has file name, size and extension? Could you please help us?

Checkstyle custom check access property value?

Can someone tell me or point me to some documentation regarding Checkstyle custom checks and accessing property values?
My custom class needs to obtain a regex file the users supply. Can they supply this file as a property in the Checkstyle .xml config file? If so, how does my custom Check class read the value of the property?
thanks.
I found a way around this problem. Just set a java Property using -Dpropertyname=propertyvalue, then in the custom class get the property value.