private void removeHeaderFromFile(String path) {
        try {
            while (!propertiesXML.contains("</" + rootName + ">")) {
                if (removeFirstLine(path) == -1) {
                    CryptoProperies cp = new CryptoProperies();
                    cp.error = "error";
                    propertiesXML = xstream.toXML(cp);
                    break;
                }
            }
        } catch (IOException ex) {
            Logger.addMessage("Exception in removeHeaderFromFile: " + ex);
        }
    }