How do I set the File Expire Header with Rackspace CloudFiles .NET API - rackspace-cloud

I'm trying to set X-Delete-After and X-Delete-At to a file i'm uploading.
So i tired :
FileMetaData.Add("X-Delete-After", "30");
cloudFilesProvider.UpdateObjectMetadata(inStrContainerID, strDesFileName, FileMetaData);
but the header did not get recognized.
is that the right approach?
Edit: I'm trying to use ICloudFilesMetadataProcessor.ProcessMetadata, but really have no clue how to and am not able to find any documentation.

In the current release of the SDK, you can include the X-Delete-After or X-Delete-At value in the headers argument to the following calls:
IObjectStorageProvider.CreateObject
IObjectStorageProvider.CreateObjectFromFile
Currently there is no way in the SDK to change the value of this header after the file has already been uploaded (e.g. using UpdateObjectMetadata as you suggest in the question would set the values X-Object-Meta-X-Delete-After or X-Object-Meta-X-Delete-After, which is not correct).
Here is a related issue on GitHub:
#167: How to assign version folder

Gopstar --
EDITED:
After more investigation; I set the X-Delete-After to 1500 and the code worked. Sort of. When viewing the file header information via the dashboard, the X-Delete-At was set.
However, the result was correct; the X-Delete-At was equal to what would be 1500 seconds from the time I set it.
Original reply:
I played around; if you set the value higher (for example, I tried X-Delete-After = 3000) it will work.
I do NOT know the lowest number acceptable, but I'm sure someone will chime in with the number.
Hope this give SOME help.

Related

outputting a different value in report

I have 100+ feature files that each year need to be updated with the year of the request ie this year they show 22-23 but next it will be 23-24 in almost every test. We created a step that allowed us to us a variable instead that we set in config eg
currentYear: 22-23
which we can then manipulate in our step to use currentYear+1 currentYear-5 etc. This all works fine and means that annually we simply change the config however on the output it shows the variable name rather than the value...eg
And Path Parameters:
year: [currentYear]
What I need it to do is show that as the value it actually used.
year: 22-23
No doubt this is something simple but I can't quite seem to get it! Any pointers would be greatly appreciated.
If you are using Maven you can filter resources before they're used in a test. This would allow you to use a variable in your feature files and have it replaced when tests are executed.
https://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html
I'm certain Gradle has a similar feature.
Note that these filtered resources will be put on the classpath. So you should use classpath:com/example.feature as your feature path and not src/main/resources/com/example.feature. If JUnit 5 is used #SelectClasspathResource("com/example.feature").

uninitialized constant OrigenTesters

I am working on transferring one application from rgen to Origen.
I added environment/j750.rb in my application.
added the below code into j750.rb
# environment/j750.rb
$tester = OrigenTesters::J750.new
in Target folder, I also added $test as below:
$tester = OrigenTesters::J750.new
however, when I tried to generate pattern, it still failed and showed'uninitialized constant OrigenTesters'.
When and how to initialize it?
Thanks a lot in advance!
Normally this is something that Origen users don't particularly need to worry about, if you add:
gem 'origen_testers'
to your application's Gemfile, then it will be required automatically and a reference like OrigenTesters in your environment file or anywhere else will just work.
However, I note that you mention upgrading from an rgen app, which means that your application must be very old and in fact may not even have a Gemfile.
If you contact me internally I can send you the link to our intranet page which has a guide on how to update these really old apps.

Using mailutils-config to set askcc to False

When it comes to email configuration, I am not a smart man. I know I need to use mailutils-config or mu-tools to change the default value of 'askcc' to False, likely in an /etc/mailutils.rc file ... However, this file doesn't exist. Do I populate it myself and then alter the settings? Is there a one-liner I can use?
I've been all over http://mailutils.org/manual/mailutils.html, and that's how I know what I need to do - but not how to do it. Can anyone help? Thank you.
edit: On Ubuntu 13.10
I installed mailutils just yesterday and today spent hours trying to set the mail variable "savekeep" to True. The mailutils documentation is poor but I got things to work after finding
2.4.7 Personal and System-wide Configuration Files. So then the task is to find out how to write the settings in a mailrc file. You can refer to .mailrc File Format on the ibm.com website.
You need to create the file ~you/.mailrc for user configuration or /etc/mail.rc for system wide configuration. Here is what you need to write in the file to set "savekeep" and "askcc".
set askcc=False;
set keepsave=True;

FTP.retrbinary fails

I'm a complete Python novice, so I apologize if the solution to my problem seems obvious. I'm having difficulty with some relatively simple code that I've written. I've scanned several related questions that have already been posted, but I don't see where my code differs in any meaningful way from the solutions suggested.
I'm trying to write a program that will:
Establish a ftp connection to a remote server.
Change the working directory on the ftp server.
Retrieve a list of files in the working directory from the ftp server.
Find a file ending with a specific suffix from the retrieved list of files.
Retrieve the found file to a temporary directory (created by tempfile.mkdtemp()) on the user's local file system.
Steps 1 through 4 are working as expected. Sadly, the last step is falling into my except clause.
Can anyone make a suggestion regarding what might be wrong with the following line of code?
ftp.retrbinary('RETR ' + file, open(opsys.path.join(localTempDir, fileName)).write)
Your suggestions are greatly appreciated. Thanks, in advance.
Possible problems:
- type(file) = incorrect value
- opsys.path.join(localTempDir, fileName) = incorrect value #nonexistent file
Thats all what comes to mind looking on presented line of code =)

Getting echofunc.vim to work

I came across echofunc.vim today (from a link in SO). Since I'm rubbish at remembering the order of function parameters, it looked like a very useful tool for me.
But the documentation is a bit lean on installation! And I've not been able to find any supplementary resources on the internet.
I'm trying to get it running on a RHEL box. I've copied the script into ~/.vim/plugin/echofunc.vim however no prompt when I type in a function name followed by '('. I've tried adding
let g:EchoFuncLangsUsed = ["php","java","cpp"]
to my .vimrc - still no prompting.
I'm guessing it needs to read from a dictionary somewhere - although there is a file in /usr/share/vim/vim70/ftplugin/php.vim, this is the RH default and does not include an explicit function list.
I'm not too bothered about getting hints on the functions/methods I've defined - just trying to get hints for the built-in functions. I can see there is a dictionary file available here which appears to provide the resources required for echofunc.vim, I can't see how I set this up.
TIA,
It expects a tags file, the last line of the description describes exactly how to generate it:
ctags -R --fields=+lS .
It works here with PHP but not with JS. Your mileage may vary.
I didn't know about this plugin, thanks for the info.
You should try phpcomplete.vim, it shows a prototype of the current function in a scratchpad. It is PHP only, though.

Resources