common/src/main/java/com/genexus/reports/ParseINI.java
/** Guarda el INI
	 * @param oStrem el Outputstream
	 */
Guarda el INI
@param oStrem el Outputstream
Guarda el INI @param oStrem el Outputstream
public void save(OutputStream oStream) throws IOException
	{
		OutputStreamWriter outputStream = new OutputStreamWriter(oStream, "UTF8");
		Enumeration props, secs;
		String prop, value;
		int it;
		if(general!=null)
		{
			props = general.keys();
			while(props.hasMoreElements())
			{
				prop=(String)props.nextElement();
				if((value = (String)getGeneralProperty(prop)).equals(""))continue;
				if((value.length() + prop.length() + 4) > MAX_LINE_LENGTH)it = (MAX_LINE_LENGTH - prop.length() - 4);
				else it = value.length();
				outputStream.write(prop + "= " + value.substring(0, it) + "\r\n");
				for(; (value.length() - it) > ( MAX_LINE_LENGTH - 4) ; it+= (MAX_LINE_LENGTH - 4))
					outputStream.write(" " + value.substring(it, it + (MAX_LINE_LENGTH - 4)) + "\r\n");
				if(it < value.length())outputStream.write(" " + value.substring(it) + "\r\n");
			}
		}
		secs=sectionNames();
		while(secs.hasMoreElements())
		{
			String section=(String)secs.nextElement();
			outputStream.write("\r\n["+section+"]\r\n");
			props = sections.get(section).keys();
			while(props.hasMoreElements())
			{
				prop=(String)props.nextElement();
				if((value = (String)getProperty(section, prop)).equals(""))continue;
				if((value.length() + prop.length() + 4) > MAX_LINE_LENGTH)it = (MAX_LINE_LENGTH - prop.length() - 4);
				else it = value.length();
				outputStream.write(prop + "= " + value.substring(0, it) + "\r\n");
				for(; (value.length() - it) > ( MAX_LINE_LENGTH - 4) ; it+= MAX_LINE_LENGTH - 4)
					outputStream.write(" " + value.substring(it, it + MAX_LINE_LENGTH - 4) + "\r\n");
				if(it < value.length())outputStream.write(" " + value.substring(it) + "\r\n");
			}
		}
		outputStream.close();
		need2Save = false;
	}
public void save ( OutputStream oStream ) throws IOException { OutputStreamWriter outputStream = new OutputStreamWriter ( oStream , "UTF8" ) ; Enumeration props , secs ; String prop , value ; int it ; if ( general != null ) { props = general . keys ( ) ; while ( props . hasMoreElements ( ) ) { prop = ( String ) props . nextElement ( ) ; if ( ( value = ( String ) getGeneralProperty ( prop ) ) . equals ( "" ) ) continue ; if ( ( value . length ( ) + prop . length ( ) + 4 ) > MAX_LINE_LENGTH ) it = ( MAX_LINE_LENGTH - prop . length ( ) - 4 ) ; else it = value . length ( ) ; outputStream . write ( prop + "= " + value . substring ( 0 , it ) + "\r\n" ) ; for ( ; ( value . length ( ) - it ) > ( MAX_LINE_LENGTH - 4 ) ; it += ( MAX_LINE_LENGTH - 4 ) ) outputStream . write ( " " + value . substring ( it , it + ( MAX_LINE_LENGTH - 4 ) ) + "\r\n" ) ; if ( it < value . length ( ) ) outputStream . write ( " " + value . substring ( it ) + "\r\n" ) ; } } secs = sectionNames ( ) ; while ( secs . hasMoreElements ( ) ) { String section = ( String ) secs . nextElement ( ) ; outputStream . write ( "\r\n[" + section + "]\r\n" ) ; props = sections . get ( section ) . keys ( ) ; while ( props . hasMoreElements ( ) ) { prop = ( String ) props . nextElement ( ) ; if ( ( value = ( String ) getProperty ( section , prop ) ) . equals ( "" ) ) continue ; if ( ( value . length ( ) + prop . length ( ) + 4 ) > MAX_LINE_LENGTH ) it = ( MAX_LINE_LENGTH - prop . length ( ) - 4 ) ; else it = value . length ( ) ; outputStream . write ( prop + "= " + value . substring ( 0 , it ) + "\r\n" ) ; for ( ; ( value . length ( ) - it ) > ( MAX_LINE_LENGTH - 4 ) ; it += MAX_LINE_LENGTH - 4 ) outputStream . write ( " " + value . substring ( it , it + MAX_LINE_LENGTH - 4 ) + "\r\n" ) ; if ( it < value . length ( ) ) outputStream . write ( " " + value . substring ( it ) + "\r\n" ) ; } } outputStream . close ( ) ; need2Save = false ; }
Guarda el INI
 @param oStrem el Outputstream
Guarda el INI @param oStrem el Outputstream