All pastes #2055232 Raw Edit

Unnamed

public java v1 · immutable
#2055232 ·published 2011-05-08 09:35 UTC
rendered paste body
Tähän tyyliinFile file = new File( getDataFolder() + "/DropPlugin.properties" );		if( !file.exists() )    	{			new File( getDataFolder().toString() ).mkdir();            Properties pr = new Properties();			try            {                FileInputStream in = new FileInputStream(file);                pr.load(in);                dropglass = Boolean.parseBoolean(pr.getProperty("drop-glass"));            }            catch (IOException e)            {				log.warning (LOG_PREFIX + "Exception: " + e.getMessage());				log.warning (LOG_PREFIX + "Could not create a configuration file!");            }    	}    	else    	{    		File dir = new File(getDataFolder().toString());        	if (!dir.exists())        	{        		dir.mkdir();        	}    	    try    	    {                file.createNewFile();                                 try                {        			PrintWriter out = new PrintWriter(new FileWriter(getDataFolder()+"/DropPlugin.properties"));        			out.println("drop-glass=true");        			out.close();        		}                catch (IOException e)        		{        			e.printStackTrace();        		}    	     }    	    catch(IOException ioe)    	    {    	    }    	}    }