Terms and conditions
Preamble:
This Agreement, signed on Jun 10, 2012 [hereinafter: Effective Date] governs the relationship between the Enduser, a private person, (hereinafter: Licensee) and Paul N...
If you think the Android project Operation-Valkyrie listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package valkyrie.filter;
/*www.java2s.com*/import java.io.IOException;
import java.io.InputStream;
import android.content.Context;
import android.content.res.AssetManager;
import android.util.Log;
/**
*
* COPYRIGHT: Paul Neuhold, Laurenz Theuerkauf, Alexander Ritz, Jakob Schweighofer, Milo Tischler
* ? Milo Tischler, Jakob Schweighofer, Alexander Ritz, Paul Neuhold, Laurenz Theuerkauf
*
*//**
* Filters can access their asset folder by their FilterAssets object
*/publicclass FilterAssets {
privatestaticfinal String TAG = "FilterAssets";
private AssetManager assetManager = null;
private String filterPath = null;
/**
* Initialize android assets
*
* @param IFilter filter
* @param Context context
*/public FilterAssets(IFilter filter, Context context) {
this.filterPath = new String(filter.getClass().getSimpleName());
this.assetManager = context.getAssets();
Log.i(TAG, "Init asset folder access for filter: " + filter.getClass().getSimpleName());
}
/**
* Returns a list of all the files and folders in the filter asset folder
*
* @param String path inside the asset folder
* @return String[]
* @throws IOException
*/public String[] list(String path) throws IOException {
if(path.equals("/") || path.equals("\\")) {
path = "";
}
return this.assetManager.list(this.filterPath + "/" + path);
}
/**
* Opens a InputStream to a file in the filter asset folder
*
* @param String fileName
* @return InputStream
* @throws IOException
*/public InputStream open(String fileName) throws IOException {
return this.assetManager.open(this.filterPath + "/" + fileName);
}
}