What is the myme type of a .gem file? - mime-types

so I was setting up an action that would upload to release the build of a gem (so a .gem file), but the action requires asset_content_type for the file to upload. From there the question... what is the mime-type of a .gem file?

Fairly sure it's application/octet-stream which is generally the default for binary content.

Related

team work with codename one

i am a student and i am a member of a group of five...
We have to work in the same project using git and we are using Scrum method in our work, so , we need some guide and best practice and answers before starting...we will be so happy with your informations.
can we use différent IDE (intellij and Netbeans)... if yes, the .gitinore file will contains every IDE 's specefic .gitignore file?
You can use this to get started: https://www.codenameone.com/blog/tip-using-git-for-codename-one-projects.html
e.g. sample gitignore from https://github.com/codenameone/MaterialScreensUIKit
*.jar
nbproject/private/
build/
nbbuild/
dist/
lib/CodenameOne_SRC.zip
psds/.DS_Store
.DS_Store
In your theme editor make sure the File -> XML Team Mode is checked for everyone so you can work on XML and individual files rather than the whole thing.
Alternatively you can avoid the designer tool altogether and use CSS.

Re-compile config file for WPF application?

After build my solution (WPF application), the config file is created in project\bin\debug folder. Whenever a change is made to this config file, I have to re-compile/rebuild the project to pull the changes from the config file.
Is there a way to avoid re-compiling the project after making a change in config?
This somehow throws the whole purpose of config file.
If you talk about the App.config file (an XML file where you usually put appSettings, connectionStrings, etc): it is possible to modify this one without to recompile your project / solution. Just navigate to the project\bin\debug folder, there you'll find a file that is called {AssemblyName}.exe.config which you can edit (actually, this is a renamed version of the App.config file, this happens when the build process copies it to the output directory).
If you talk about XAML related files: these are by default not configurable because they get translated to BAML (Binary Application Markup Language) files that are embedded to the assembly in a default WPF project. If you change those you have to recompile.
You do not need to recompile your project. Your assumption is wrong.
if you edit OutputDir\{appname}.exe.config, then it will take effect immediatelly. However, if you rebuild your app, this config file is overwritten by app.config from your project folder

How to rename a file extension with NetBeans?

I'm use NetBeans 8 for my new Maven Java Web project.
The code generation really helps.
But, how Am I supposed to rename the extension of a file?
hello.jsp --> hello.xhtml
NetBeans "rename" only allow to change the first part, not the extension. Do I really have to go to my system-folder and change the file there?
You have to edit the properties. Right click on the file -> Properties.
A dialog will open where you can change the extension and more.
you can't change the fileExtension with rightClick, when the file is open! close the editTab and then u can change the extension.
When the file is open, u get with rightClick/Properties other options!
Rename the file outside of Netbeans using a file browser for your OS and the extension will automatically change in Netbeans.
When you install the Files In Explorer plugin for Netbeans you can quickly open the folder from within Netbeans by right clicking the folder and selecting "Open in System Browser". From there you can rename the file extension.
To my knowledge, you can't change the extension. In NetBeans you create an object and work with that; there's no method to convert that into another type of object.
To solve your problem, you can create a new hello.xhtml object and copy the code. Or change the extension on the file system, outside of NetBeans.
It is also possible to provide a desired extension when you save a copy of an already opened file. Afterwards you can delete the file with the wrong extension.

Passing in a file path to FileReader

Using Netbeans, I am trying to pack some text file resources that are read by a FileReader into a JAR file, but since the text files aren't located in the resources folder, the JAR cannot find them. How can I tell the filereader where to look for the files? (Such as "/src/resources/maps/level1.txt" in my case.)
Currently, the text files are stored in the project folder and can be read from there using "filename.txt"
Hmm. this sounds like two questions. First, resources get packed into a JAR file and can't be read directly as files (yes, you can execute classes on "exploded" directory mode but your code shouldnt depend on this). Once you have generated a JAR file containing your classes and the resources, you can access the resource using an InputStreamReader, not a FileReader
new InputStreamReader(this.getClass().getResourceAsStream("/maps/level1.txt"));
The reason that getResourceAsStream() is on the Class object, is that sometimes resources are placed in same package as a class. Using..
this.getClass().getResourceAsStream("level1.txt")
without a / slash at the front of the path, this would try to locate this in the same package as "this" object.
When resources are in the root package, or have their own directory structure, /maps/ for example. You can call this.getClass() on any class (in the same classloader) to find the resource.

Tika: MIME-Type detection of Js, Css

I use Apache Tika to extract text of all kind of files. Now I also want to use it to detect the correct MIME-type of a file.
This works for example for...
PDF-Files (application/pdf)
HTML-Files (text/html)
...but not for:
CSS-Files (text/plain instead of text/css)
Javascript-files (text/plain instead of text/javascript)
...
(These Mime-type-results come from my application and also from the tika-app).
I need for my application an exact MIME-type like text/css instead of the general text/plain. Is this possible with Tika?
You need to do two things. Firstly, you need to supply the filename to Tika, so it can use that to help specialise the plain text type into the appropriate subtype (CSS, JS etc). Secondly, you need to make sure you're using a new enough version of Tika.
I've just tried with the latest version of Tika, and with passing the filename in, and it can detect JS and CSS files just fine:
$ java -jar tika-app-1.3-SNAPSHOT.jar --detect testCSS.css
text/css
$ java -jar tika-app-1.3-SNAPSHOT.jar --detect testJS.js
application/javascript
Also, the latest version of Tika (as of r1400795) has a unit test that automatically verifies that JS and CSS detection work, so you can be doubly sure it works fine!

Resources