@Override public T call() throws IOException { return (T) Items.load(parent, rootDir); } });
@Override public TopLevelItem call() throws IOException { return (TopLevelItem) Items.load(parent, dir); } });
public void run(Reactor session) throws Exception { if(!Items.getConfigFile(subdir).exists()) { //Does not have job config file, so it is not a jenkins job hence skip it return; } TopLevelItem item = (TopLevelItem) Items.load(Jenkins.this, subdir); items.put(item.getName(), item); loadedNames.add(item.getName()); } }));
XmlFile xmlFile = Items.getConfigFile(subdir); if (xmlFile.exists()) { item = (V) Items.load(parent, subdir); } else { Logger.getLogger(ItemGroupMixIn.class.getName()).log(Level.WARNING, "could not find file " + xmlFile.getFile());
@Override public T call() throws IOException { return (T) Items.load(parent, rootDir); } });
@Override public TopLevelItem call() throws IOException { return (TopLevelItem) Items.load(parent, dir); } });
/** * Loads a {@link Item} from a config file. * * @param dir The directory that contains the config file, not the config * file itself. */ public static Item load(ItemGroup parent, File dir) throws IOException { return load(parent, dir, true); }
public void run(Reactor session) throws Exception { TopLevelItem item = (TopLevelItem) Items.load(Hudson.this, subdir); items.put(item.getName(), item); } });
public void run(Reactor session) throws Exception { TopLevelItem item = (TopLevelItem) Items.load(Hudson.this, subdir); items.put(item.getName(), item); } });
public void run(Reactor session) throws Exception { TopLevelItem item = (TopLevelItem) Items.load(Hudson.this, subdir); items.put(item.getName(), item); } });
public void run(Reactor session) throws Exception { TopLevelItem item = (TopLevelItem) Items.load(Hudson.this, jobRootDir); items.put(item.getName(), item); } });
/** * Reload a project to update its definition. * @since 2.x.x */ public TopLevelItem reloadProjectFromDisk(File jobDir) throws IOException { TopLevelItem item = (TopLevelItem) Items.load(this, jobDir); items.put(item.getName(), item); rebuildDependencyGraph(); return item; }
/** * Reload a project to update its definition. * @since 2.x.x */ public TopLevelItem reloadProjectFromDisk(File jobDir) throws IOException { TopLevelItem item = (TopLevelItem) Items.load(this, jobDir); items.put(item.getName(), item); rebuildDependencyGraph(); return item; }
/** * Reload a project to update its definition. * @since 2.x.x */ public TopLevelItem reloadProjectFromDisk(File jobDir) throws IOException { TopLevelItem item = (TopLevelItem) Items.load(this, jobDir); items.put(item.getName(), item); rebuildDependencyGraph(); return item; }
/** * Reload a project to update its definition. * * @since 2.x.x */ public TopLevelItem reloadProjectFromDisk(File jobDir) throws IOException { TopLevelItem item = (TopLevelItem) Items.load(this, jobDir, false); items.put(item.getName(), item); rebuildDependencyGraph(); return item; }
private void loadProcesses(File[] subdirs) throws IOException { if(subdirs!=null) { for (File subdir : subdirs) { try { PromotionProcess p = (PromotionProcess) Items.load(this, subdir); safeAddToProcessesList(p); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to load promotion process in "+subdir,e); } } } buildActiveProcess(); }
public void run(Reactor session) throws Exception { if(!Items.getConfigFile(subdir).exists()) { //Does not have job config file, so it is not a jenkins job hence skip it return; } TopLevelItem item = (TopLevelItem) Items.load(Jenkins.this, subdir); items.put(item.getName(), item); loadedNames.add(item.getName()); } });
public synchronized TopLevelItem createProjectFromXML(String name, InputStream xml) throws IOException { acl.checkPermission(Job.CREATE); // place it as config.xml File configXml = Items.getConfigFile(getRootDirFor(name)).getFile(); configXml.getParentFile().mkdirs(); try { IOUtils.copy(xml,configXml); // load it TopLevelItem result = (TopLevelItem)Items.load(parent,configXml.getParentFile()); add(result); ItemListener.fireOnCreated(result); Hudson.getInstance().rebuildDependencyGraph(); return result; } catch (IOException e) { // if anything fails, delete the config file to avoid further confusion Util.deleteRecursive(configXml.getParentFile()); throw e; } }
public synchronized TopLevelItem createProjectFromXML(String name, InputStream xml) throws IOException { acl.checkPermission(Job.CREATE); // place it as config.xml File configXml = Items.getConfigFile(getRootDirFor(name)).getFile(); configXml.getParentFile().mkdirs(); try { IOUtils.copy(xml,configXml); // load it TopLevelItem result = (TopLevelItem)Items.load(parent,configXml.getParentFile()); add(result); ItemListener.fireOnCreated(result); Hudson.getInstance().rebuildDependencyGraph(); return result; } catch (IOException e) { // if anything fails, delete the config file to avoid further confusion Util.deleteRecursive(configXml.getParentFile()); throw e; } }
/** * Copies an existing {@link TopLevelItem} to a new name. * * The caller is responsible for calling {@link ItemListener#fireOnCopied(Item, Item)}. This method * cannot do that because it doesn't know how to make the newly added item reachable from the parent. */ @SuppressWarnings({"unchecked"}) public synchronized <T extends TopLevelItem> T copy(T src, String name) throws IOException { acl.checkPermission(Job.CREATE); T result = (T)createProject(src.getDescriptor(),name,false); // copy config Util.copyFile(Items.getConfigFile(src).getFile(),Items.getConfigFile(result).getFile()); // reload from the new config result = (T)Items.load(parent,result.getRootDir()); result.onCopiedFrom(src); add(result); ItemListener.fireOnCopied(src,result); return result; }