How to send property values containing '='? - artifactory

According to your documentation, a user can send properties via the upload URI.
How to pass = as a property value?
I have tried with \= and %3D, but in both the cases I get a truncated value. All the properties after the problematic one are lost, too.
This same problem affects the jfrog-cli-go.

Jfrog-cli version 1.5.0 upload command will support uploading files with properties contains special characters.
jfrog rt u froggy.tgz my-local-repo --props=prop==+\~ // upload froggy.tgz and set prop as property with =+\~ as value.
Follow Jfrog-cli releases at:
https://bintray.com/jfrog/jfrog-cli-go/

Related

Getting a file via an API with the file name containing a plus sign

We are currently working with an API for file upload and download.
We upload the file successfully, yet we can't download it. We have found that some of the files contain a '+' character which seems to be the issue here.
My question is, if we call the API like so :
nameoffile = "testing+test"
https://sitename/api/filesystem/nameoffile
Could there be another way of calling the API so the clients/browsers handle the name in the way we need them to?
Yes. You're talking about URLEncoding special characters: https://www.tutorialspoint.com/html/html_url_encoding.htm
In your case, a '+' character encodes to "%2B":
nameOfFile = "testing%2Btest"
url = "https://www.google.com/abc/"+nameOfFile

Can I set the asterisk_version string

I am trying various different options of building Asterisk 11 and these will be deployed on various servers. They are all built from the same sources and have what I presume to be some sort of checksum embedded in the version ID (26dd464).
In order to distinguish the various versions of the executable I would like to add my own version number or string on similar. I note that /usr/src/asterisk/main/version.c specifies a const char [] variable asterisk_version, but if I manually edit this it gets overwritten as part of the make process. Is there a sensible way I could specify some sort of identifying label (e.g. as a parameter passed to make or some such)?
In /usr/src/asterisk/build_tools/make_version_c you can specify it. This script overwrites the file you've mentioned (/usr/src/asterisk/utils/version.c).

Omnifaces FileServlet - change Output link path from image

I´m using the FileServlet from Omnifaces:
http://showcase.omnifaces.org/servlets/FileServlet
It works fine and all my images appears in my webapp.
But now I would like to change the link from the image because I would like to avoid that someone enter the path from another image:
For example:
The path from one image is:
myapp/imagesservlet/mypic1.jpg
-> Someone can enter
myapp/imagesservlet/mypic2.jpg -> and got another image.
My files are stored as:
mypic like mypic1.jpg, mypic2.jpg.....
Is there any chance to change the path and got also the correct image?
Just use unpredictable autogenerated filenames. E.g. imgur also does that. This responsibility is actually beyond the OmniFaces FileServlet as all it does is just inspecting the passed-in filename and serving it up. You should change the passed-in filename to be an autogenerated one. Save if necessary the original filename somewhere else, e.g. in a SQL database, if necessary along with other metadata (content type, size, etc) so it can more efficiently be indexed and searched.
How to autogenerate a random string in Java is already covered in this Q&A: How to generate a random alpha-numeric string?

How to exclude imported URL parameters when they have no value?

I've installed the Swagger Importer, which is just great. It saved a lot of setup time. It also enumerated all of our APIs optional parameters, which is also good because I don't have to reference docs; however, I don't want GET and POST requests to send the params when I haven't explicitly set the values. Is there a way to configure PAW to not send URL Params when they have no value? One option is to just duplicate an item and then prune the list, but it seems reasonable that there should be a way to simply ignore items that aren't set.
For example:
Don't GET:
http://domain.com/api/v1/users?maxResultCount=&isActive=true
(because maxResultCount is optional and not set)
Instead, do GET:
http://domain.com/api/v1/users?isActive=true
The current release, Paw Version 3.0.7 (Retail) now provides checkboxes on URL parameters.

How do get the path of destination where image is saved using Glide (Image loading library Android)

Glide uses disk caching (both internal and external). The way it stores the file name is encoded in some format. It is possible to get the original file name/file path, where the image is downloaded ?
Glide uses a two-level cache in 3.x: SOURCE and RESULT. The default caching (if you don't specify a .diskCacheStrategy() is RESULT. Currently there's no public way to figure out which file corresponds to a normal Glide load (RESULT cache).
The main article about caching is: https://github.com/bumptech/glide/wiki/Caching-and-Cache-Invalidation
Many have tried to mess with the cache.
The solution is based on your use case and you can choose one of:
.sigunature(): invalidate a single item in cache when signature changes
.downloadOnly(): get the File handle to a SOURCE cache item
.asBytes(): returns JPG/PNG encoded byte[] instead of a Drawable/Bitmap
Glide.get(context).clearDiskCache(): last resort only, removes everything

Resources