All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.thoughtworks.gauge.refactor.FileModifier Maven / Gradle / Ivy

There is a newer version: 0.11.0
Show newest version
/*----------------------------------------------------------------
 *  Copyright (c) ThoughtWorks, Inc.
 *  Licensed under the Apache License, Version 2.0
 *  See LICENSE.txt in the project root for license information.
 *----------------------------------------------------------------*/
package com.thoughtworks.gauge.refactor;

import org.apache.commons.io.FileUtils;

import java.io.IOException;

public class FileModifier {
    private JavaRefactoringElement javaElement;

    public FileModifier(JavaRefactoringElement javaElement) {
        this.javaElement = javaElement;
    }

    public void refactor() throws IOException {
        write();
    }

    private void write() throws IOException {
        FileUtils.write(javaElement.getFile(), javaElement.getText(), JavaParseWorker.ENCODING);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy