protected ContentProvider createConfFilesContent () throws IOException { if ( this.confFiles.isEmpty () ) { return ContentProvider.NULL_CONTENT; } final StringWriter sw = new StringWriter (); for ( final String confFile : this.confFiles ) { sw.append ( confFile ).append ( '\n' ); } sw.close (); return new StaticContentProvider ( sw.toString () ); }
protected ContentProvider createConfFilesContent () throws IOException { if ( this.confFiles.isEmpty () ) { return ContentProvider.NULL_CONTENT; } final StringWriter sw = new StringWriter (); for ( final String confFile : this.confFiles ) { sw.append ( confFile ).append ( '\n' ); } sw.close (); return new StaticContentProvider ( sw.toString () ); }
public void addFile ( final byte[] content, final String fileName, final EntryInformation entryInformation ) throws IOException { addFile ( new StaticContentProvider ( content ), fileName, entryInformation ); }
public void addFile ( final String content, final String fileName, final EntryInformation entryInformation ) throws IOException { addFile ( new StaticContentProvider ( content ), fileName, entryInformation ); }
public void addFile ( final byte[] content, final String fileName, final EntryInformation entryInformation ) throws IOException { addFile ( new StaticContentProvider ( content ), fileName, entryInformation ); }
public void addFile ( final String content, final String fileName, final EntryInformation entryInformation ) throws IOException { addFile ( new StaticContentProvider ( content ), fileName, entryInformation ); }
protected ContentProvider createChecksumContent () throws IOException { if ( this.checkSums.isEmpty () ) { return ContentProvider.NULL_CONTENT; } final StringWriter sw = new StringWriter (); for ( final Map.Entry<String, String> entry : this.checkSums.entrySet () ) { final String filename = entry.getKey ().substring ( 2 ); // without the leading dot and slash sw.append ( entry.getValue () ); sw.append ( " " ); sw.append ( filename ); sw.append ( '\n' ); } sw.close (); return new StaticContentProvider ( sw.toString () ); }
protected ContentProvider createChecksumContent () throws IOException { if ( this.checkSums.isEmpty () ) { return ContentProvider.NULL_CONTENT; } final StringWriter sw = new StringWriter (); for ( final Map.Entry<String, String> entry : this.checkSums.entrySet () ) { final String filename = entry.getKey ().substring ( 2 ); // without the leading dot and slash sw.append ( entry.getValue () ); sw.append ( " " ); sw.append ( filename ); sw.append ( '\n' ); } sw.close (); return new StaticContentProvider ( sw.toString () ); }
public static ContentProvider createContent ( final InputStream resource, final Map<String, String> replacements, final Pattern pattern ) throws IOException { try { String str = CharStreams.toString ( new InputStreamReader ( resource, StandardCharsets.UTF_8 ) ); str = StringReplacer.replace ( str, StringReplacer.newSource ( replacements ), pattern ); return new StaticContentProvider ( str ); } finally { resource.close (); } }
protected ContentProvider createControlContent () throws IOException { this.packageControlFile.set ( BinaryPackageControlFile.Fields.INSTALLED_SIZE, "" + this.installedSize ); final StringWriter sw = new StringWriter (); try ( ControlFileWriter writer = new ControlFileWriter ( sw ) ) { this.packageControlFile.write ( writer ); } sw.close (); return new StaticContentProvider ( sw.toString () ); }
protected ContentProvider createControlContent () throws IOException { this.packageControlFile.set ( BinaryPackageControlFile.Fields.INSTALLED_SIZE, "" + this.installedSize ); final StringWriter sw = new StringWriter (); try ( ControlFileWriter writer = new ControlFileWriter ( sw ) ) { this.packageControlFile.write ( writer ); } sw.close (); return new StaticContentProvider ( sw.toString () ); }
public static ContentProvider createContent ( final InputStream resource, final Map<String, String> replacements, final Pattern pattern ) throws IOException { try { String str = CharStreams.toString ( CharStreams.newReaderSupplier ( new InputSupplier<InputStream> () { @Override public InputStream getInput () throws IOException { return resource; } }, Charset.forName ( "UTF-8" ) ) ); //$NON-NLS-1$ str = StringReplacer.replace ( str, StringReplacer.newSource ( replacements ), pattern ); return new StaticContentProvider ( str ); } finally { resource.close (); } }
@Override protected void handleProcess ( final IFolder nodeDir, final IProgressMonitor monitor, final Map<String, String> properties ) throws Exception { if ( this.deploymentContext != null ) { runSetup ( this.deploy, this.deploymentContext, new SubProgressMonitor ( monitor, 1 ) ); if ( !makeEquinoxList ().isEmpty () ) { final String data = StringHelper.join ( makeEquinoxList (), "\n" ) + "\n"; this.deploymentContext.addFile ( new StaticContentProvider ( data ), "/etc/eclipsescada/applications", new FileInformation ( 0644, null, null, FileOptions.CONFIGURATION ) ); } } }
@Override protected void handleProcess ( final IFolder nodeDir, final IProgressMonitor monitor, final Map<String, String> properties ) throws Exception { if ( this.deploymentContext != null ) { runSetup ( this.deploy, this.deploymentContext, new SubProgressMonitor ( monitor, 1 ) ); if ( !makeEquinoxList ().isEmpty () ) { final String data = StringHelper.join ( makeEquinoxList (), "\n" ) + "\n"; this.deploymentContext.addFile ( new StaticContentProvider ( data ), "/etc/eclipsescada/applications", new FileInformation ( 0644, null, null, FileOptions.CONFIGURATION ) ); } } }