Here you can find the source of save(String path, byte[] content, IProgressMonitor monitor)
Parameter | Description |
---|---|
path | the file's path. |
content | the file's content. |
monitor | the progress monitor. |
Parameter | Description |
---|---|
IOException | throw if an I/O error occurs. |
public static void save(String path, byte[] content, IProgressMonitor monitor) throws IOException
//package com.java2s; /**/*from w w w . j av a2s . c o m*/ * This file is part of emf2gv : an eclipse plugin that allows to * generate a graphical representation of an EMF model. * * Copyright 2010-2011 Jean-Francois Brazeau * * emf2gv is free software: you can redistribute it and/or modify * it under the terms of either: * * a) the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * or * b) the Eclipse Public License version 1.0 as published by * the Eclipse Foundation. * * emf2gv is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with emf2gv. If not, see <http://www.gnu.org/licenses/>. * * You should have received a copy of the Eclipse Public License * along with emf2gv. If not, see <http://www.eclipse.org/legal/epl-v10.html>. */ import java.io.FileOutputStream; import java.io.IOException; import org.eclipse.core.runtime.IProgressMonitor; public class Main { /** * Saves a file. * * @param path * the file's path. * @param content * the file's content. * @param monitor * the progress monitor. * @return the saved file. * @throws IOException * throw if an I/O error occurs. */ public static void save(String path, byte[] content, IProgressMonitor monitor) throws IOException { monitor.beginTask("Saving " + path, 1); FileOutputStream out = new FileOutputStream(path); out.write(content); out.flush(); out.close(); } }