Created
November 17, 2020 23:46
-
-
Save techforum-repo/801df22fb32a1063906c2f30757dec18 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
package com.example; | |
import java.io.ObjectInputFilter; | |
public class CustomClassFilter implements ObjectInputFilter{ | |
public Status checkInput(FilterInfo filterInfo) { | |
Class<?> clazz = filterInfo.serialClass(); | |
if (clazz != null) { | |
return !(clazz.getName().equals("com.example.Employee")) ? Status.ALLOWED : Status.REJECTED; //clazz.getPackage().equals("com.example") | |
} | |
return Status.UNDECIDED; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment