use plain JDK api to implement HDFS? - hdfs

i want to use the plain JDK api to implement the read and write mechanism in the HDFS? but doc or reference i can find are all about how to use the HDFS api? anyone can give me some suggestion about this? reference or code both is ok? much thanks.

Related

Can I customize the MongoDB Connector

I'm trying to use MongoDB connector https://store.wso2.com/store/assets/esbconnector/details/3ce6cbda-c62b-41e0-9706-f75da51e50ee and found some missing options, is it possible to customize it? where is the source code of the connector?
Yes, you can, you can fork the code and do the changes you require, and use it. The source code is located here. You can also consider contributing it back to WSO2.
If you want to build your own connector from scratch you can take a look at this.

Provide chromedriver.exe in AWS Lambda

I built a lambda Function in java and Gradle with a Selenium Test. This test needs a chromedriver.exe File. How can I provide this File in the Zip-folder for Lambda?
Or is it the better way to provide it in an S3-Bucket?
I will suggest that you use WebDriverManager, that way you dont need to use the driver.exe anymore. Please refer to my answer in this post on how to do that
WebDriverManager

Use custom HRTF with Google Resonance

I'm currently looking into use a particular HRTF database in Unity using Google Resonance. However, I can't find documentation regarding this possibility. Could anyone help me?
Thank you very much!
The Resonance Audio SDKs use a custom HRTF database under the hood, it's not possible to replace it via an external set.
That said, you can refer to the corresponding spatial-audio section in the public spatial-media repo on GitHub for further information and resources regarding the HRIRs that are used.

Solutions within WSo2 ESB for Processing Zip files

I have the following requirement :
“Copy a Zip file from a sftp server to a directory on a local server, then unzip the file and extract 2 Xml files from inside it to process in our message service we have setup within our ESB.”
I have done some several searches over the past week on the internet, as well as read several topics in the Wso2 documentation but I cannot find a clean way to implement this requirement. I found this question asked on stackoverflow already - https://stackoverflow.com/questions/27806557/wso2-esb-extracting-and-processing-zip-files
However, I did not see where there were any suggestions/solutions provided. My first thought is to build a sequence with a class mediator to handle the extraction of the 2 xml files I need from the zip file, but maybe there is a better approach?
Is there any recommendations, links, or other references that folks could provide or suggest that would help me move forward with implementing this requirement? Or is this something I will need to handle outside of ESB via script with cron control?
Please kindly note that I'm assuming that you are using ESB 4.8.1
Since this is a specific requirement we don't have an out of the box solution for your scenario. However, you can easily do this using WSO2's VFS transport and a custom class mediator. The procedure would be:
Read your zip file using VFS Transport and save it in your local server.
Next, create a class mediator which unzip your zip file and then read your XML files. For more details about how to write a class mediator please refer Class Mediator.
If you need more help regarding this issue please let me know.
Thanks,
Upul
In the newer version of the ESB, the File Connector supports zip/unzip operations: https://docs.wso2.com/display/ESBCONNECTORS/Working+with+the+File+Connector+Version+2

File Extension to MIME Type Web Service?

Are there any web services which will allow me to provide a file extension and it would return a list of possible MIME types?
For example:
http://mimetype.com/getMime/doc
Which could return:
application/msword,application/docappl/text,application/vnd.msword,application/vnd.ms-word,application/winword,application/word,application/x-msw6,application/x-msword
I don't want to use Urlmon.dll and I would prefer not having to keep my own list up-to-date.
Thanks
I just created this as part of my mimetype <-> icon service
http://stdicon.com/
For example :
http://stdicon.com/ext/html
It runs on appengine so it should have high availability.
The only thing I could imagine would be parsing the list which comes with the apache server
mime.types. The list is maintained by The Apache Software Foundation and depends on www.iana.org
Though its not exactly what you are asking for, this information is available via search by format in the PRONOM registry. The result is more fine-grained than MIME types, but you can get MIME info if available for the results (e.g. here, in the 'identifiers' section). There is also the DROID tool available to access this information via GUI, Java API or command line interface.
Sorry that I don't have a webservice for the task on hand, but you could use the fileext page and maybe parse the response if you can query the extension programmatically. Maybe a first step in the right direction.
This webservice could be very simple, a small DB / in memory store which could be as simple as a Dictionary<String, String> and just do a key lookup and return the result.
The first dataset could be (for example) based on http://www.webmaster-toolkit.com/mime-types.shtml.
The problem would probably be the hosting of such a webservice.
I don't know if there is a web service that would do this, but the libmagic library (http://en.wikipedia.org/wiki/Libmagic) is used for identifying filetypes and might be helpful for you.
The only thing that comes to mind is to parse output from http://www.file-extensions.org/
It won't give you the MIME type, but the good olde' Microsoft File Association Web Service could still help you. You access it this way:
http://shell.windows.com/fileassoc/0409/xml/redir.asp?Ext=xls
where 0409 means English (US) and xls is the file extension. On the plus side, it will be there and constantly updated... well, until Microsoft decides to pull the plug. Which can happen any time.