converted security into a java file