Possibility of factorisation of rsa modulus due to vulnerability in java implementation code
No, this is not a safe implementation; from the modulus and the public exponent, it would be possible to factor the modulus.

The reason is that you pick the private exponent to be small; one-fifth the size as the modulus.  It's known that knowledge of a public exponent corresponding to that is sufficient to factor.

The obvious question is "why are you picking the private exponent?".  Instead, why don't you pick the public exponent (65537 is a popular choice), and derive the private exponent from that.