/** * @return String that represents the file path to a temporary file */ protected String[] createTempFile() { // create temporary file names String solutionDir = "system/tmp/"; //$NON-NLS-1$ String fileNamePrefix = "tmp_chart_"; //$NON-NLS-1$ String extension = ".png"; //$NON-NLS-1$ String fileName = null; String filePathWithoutExtension = null; try { File file = PentahoSystem.getApplicationContext().createTempFile( getSession(), fileNamePrefix, extension, true ); fileName = file.getName(); filePathWithoutExtension = solutionDir + fileName.substring( 0, fileName.indexOf( '.' ) ); } catch ( IOException e ) { getLogger().error( Messages.getInstance().getErrorString( "AbstractChartComponent.ERROR_0001_CANT_CREATE_TEMP_CHART" ), e ); //$NON-NLS-1$ } String[] value = new String[2]; value[AbstractChartComponent.FILENAME_INDEX] = fileName; value[AbstractChartComponent.FILENAME_WITHOUT_EXTENSION_INDEX] = filePathWithoutExtension; return value; }
tempDir.mkdir(); file = PentahoSystem.getApplicationContext().createTempFile( session, filename, ".tmp", true ); //$NON-NLS-1$ } else { file = new File( path + File.separatorChar + filename );
String filePathWithoutExtension = null; try { File file = PentahoSystem.getApplicationContext().createTempFile( getSession(), fileNamePrefix, extension, true ); fileName = file.getName(); filePathWithoutExtension = solutionDir + fileName.substring( 0, fileName.indexOf( '.' ) );
String filePathWithoutExtension = null; try { File file = PentahoSystem.getApplicationContext().createTempFile( getSession(), fileNamePrefix, extension, true ); fileName = file.getName(); filePathWithoutExtension = solutionDir + fileName.substring( 0, fileName.indexOf( '.' ) );