@Override
    public String getType(Uri uri) {
        // ContentProvider has already checked granted permissions
        final File file = mStrategy.getFileForUri(uri);

        final int lastDot = file.getName().lastIndexOf('.');
        if (lastDot >= 0) {
            final String extension = file.getName().substring(lastDot + 1);
            final String mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
            if (mime != null) {
                return mime;
            }
        }

        return "application/octet-stream";
    }
Returns the MIME type of a content URI returned by
{@link #getUriForFile(Context, String, File) getUriForFile()}.

@param uri A content URI returned by
           {@link #getUriForFile(Context, String, File) getUriForFile()}.
@return If the associated file has an extension, the MIME type associated with that
extension; otherwise <code>application/octet-stream</code>.
replugin-sample/plugin/plugin-demo1/app/src/main/java/com/qihoo360/replugin/sample/demo1/provider/FileProvider.java