Rexster extension with path parameters - tinkerpop

Is there any way to have path parameters in a Rexster extension, i.e. the equivalent of Jersey's #PathParam?
From what I could see from the sample extensions, only query params appear to be available.

There is no easy way to work with path parameters in Rexster. You can however access the path and make programmatic decisions on that. You can look at the Frames Extension for an example of how to do it here.
The basic idea is to grab the UriInfo from the RexsterResourceContext. From there you can reason about the path in your code.

Related

How to use relative or absolute file path in Karate.write function

I am trying to write my contents into an external file. How to define your file path in the Karate.write(value, file) ?? (I am aware that it is not recommended from the framework perspective but I have to do some JMS activity with my customised Java functions. That is why I am trying to do this)
Anyone coming across this answer in the future, please read this first: https://stackoverflow.com/a/54593057/143475
Even if you need to do JMS, I don't understand why you need to write a file. Read the above link again if you need to please. Also Karate has support for async and we even have a JMS example here: https://github.com/intuit/karate/tree/master/karate-netty#consumer-provider-example
Finally: my strong advice to you: write a Java or JS utility yourself. Look at this example for hints: upload.feature especially this part:
* def FileChecker = Java.type('com.intuit.karate.demo.util.FileChecker')
# example of parsing a string into json by karate
* json fileInfo = FileChecker.getMetadata(id)
Here we are reading a file, but you get the idea.

Get extention point contribution as text

Is there a way to get the raw XML text which another plugin has contributed to an extension point?
The normal way to access data that is contributed to an extension point is to use IConfigurationElement objects:
IConfigurationElement[] configElems = Platform.getExtensionRegistry()
.getConfigurationElementsFor(LANGUAGES_EXTENTION_POINT_ID);
But I already have JAXB parser for the kind of data that is contributed to this extension point. I'd like to use that one instead of Eclipse's classes.
EDIT 1: An alternative would be to use some kind of Eclipse-configuratoin-to-JAXB bridge library. But I don't find any.
EDIT 2: It's probably possible to find the plugin.xml of the contributing plug-in and read that manually... Probably not a good idea.
EDIT 3: I think I will do this: Instead of contributing the data directly clients get to give a file name. I then read that file using my old parser.
No, I don't see anything that would give you the XML.
getConfigurationElementsFor gives you information extracted from many different plugin.xml files so it is not clear what XML could be returned anyway.
org.eclipse.core.internal.registry.ExtensionRegistry is the extension registry implementation, but a lot of the information that uses comes from org.eclipse.core.internal.registry.RegistryObjectManager.

How can I get the used configure commandline options for the installed Qt5

I want to check if Qt5 was compiled with or without some options, regarding supported image formats. I know about the QImageReader supportedImageFormats function but I want to know the configure options.
Is there a way to retrieve the used commandline options of the configure call dynamically?
Cheers.
No, there is not. You could fake it, if you still have the source tree. In qt5/qtbase you find two files: config.summary and config.status. Those contain the info you seek. However, these files are not part of a normal installation.

Get file type of given file - based on contents

OK, it may sound fairly straightforward but I'm still not sure how to go about it.
I know it's possible to check file type based on file extensions, using UTIs (e.g. Get the type of a file in Cocoa).
However, I need to be able to get the file type (in more general terms, like "text", "image", "else"), depending on the content.
Is that possible?
Any ideas?
One route forward is to call the file command and parse its output, but that is fairly horrible, and I wouldn't do that as it's slow and you are susceptible to changes in the output.
The file command uses a pretty extensive database of byte patterns to test the contents of the file and I would be tempted to implement my own internal version of it, or use this library (which I think might need some work before it works under OSX).

What does (filename.java.i, filename.jar.i) extension mean

I have files named xxx.java.i,xxx.java.d,xxx.jar.i. I know that these file are somehow related to Java. What does this extension mean and for what is it used? Is it same type as the .class extension?
You should look at your build system for more information. It is possible that these are intermediate files that get transformed and renamed to ".java". For example, I've seen various build systems that use the ".i" suffix to mean "input", and perform various forms of variable substitution (e.g. changing something like "{VERSION_NUMBER}" to the version number of the library being compiled).
I think they are created by someone to serve his own purpose and unless we ask the author or see the content we won't know what it the purpose is.
If you see garbled characters, it's probably java bytecode and you can use some decompiler to see the code (see: How do I "decompile" Java class files?).