Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
Java
Java
package org.tupeloproject.kernel;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class ExampleContext extends Context {
    public void doPerform(BlobFetcher bf) throws OperatorException {
	        String pathname = bf.getUri().toString().replaceFirst("http://foo.bar.baz/quux", "/usr/share/data/fbbq");
	        try {
	            bf.setInputStream(new FileInputStream(pathname));
	        } catch (FileNotFoundException e) {
	            throw new NotFoundException("no file found for URI "+bf.getUri(), e);
	        }
    }
}