Created
November 11, 2015 14:39
-
-
Save stevengonsalvez/cff13c24009b62bc4de6 to your computer and use it in GitHub Desktop.
File input bug : file input stream does not close - hack to close the input stream
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.FileInputStream; | |
import org.mule.api.MuleEventContext; | |
import org.mule.api.lifecycle.Callable; | |
public class CloseStreamWorkaround implements Callable { | |
@Override | |
public Object onCall(MuleEventContext eventContext) throws Exception { | |
FileInputStream fileInput = (FileInputStream) eventContext.getMessage().getPayload(); | |
fileInput.close(); | |
MuleEventContext newContext = eventContext; | |
newContext.getMessage().setPayload(new String("Success")); | |
return newContext.getMessage().getPayload(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment