Items.whileUpdatingByXml(new NotReallyRoleSensitiveCallable<Void,IOException>() { @Override public Void call() throws IOException { onLoad(getParent(), getRootDir().getName());
TopLevelItem result = Items.whileUpdatingByXml(new NotReallyRoleSensitiveCallable<TopLevelItem,IOException>() { @Override public TopLevelItem call() throws IOException { return (TopLevelItem) Items.load(parent, dir);
/** * Reloads this job from the disk. * * Exposed through CLI as well. * * TODO: think about exposing this to UI * * @since 1.556 */ @RequirePOST public void doReload() throws IOException { checkPermission(CONFIGURE); // try to reflect the changes by reloading getConfigFile().unmarshal(this); Items.whileUpdatingByXml(new NotReallyRoleSensitiveCallable<Void, IOException>() { @Override public Void call() throws IOException { onLoad(getParent(), getRootDir().getName()); return null; } }); Jenkins.getInstance().rebuildDependencyGraphAsync(); SaveableListener.fireOnChange(this, getConfigFile()); }
result = Items.whileUpdatingByXml(new NotReallyRoleSensitiveCallable<T,IOException>() { @Override public T call() throws IOException { return (T) Items.load(parent, rootDir);
/** @see ItemGroupMixIn#createProjectFromXML */ public PromotionProcess createProcessFromXml(final String name, InputStream xml) throws IOException { owner.checkPermission(Item.CONFIGURE); // CREATE is ItemGroup-scoped and owner is not an ItemGroup Jenkins.getInstance().getProjectNamingStrategy().checkName(name); if (getItem(name) != null) { throw new IllegalArgumentException(owner.getDisplayName() + " already contains an item '" + name + "'"); } File configXml = Items.getConfigFile(getRootDirFor(name)).getFile(); File dir = configXml.getParentFile(); if (!dir.mkdirs()) { throw new IOException("Cannot create directories for "+dir); } try { IOUtils.copy(xml, configXml); PromotionProcess result = Items.whileUpdatingByXml(new MasterToSlaveCallable<PromotionProcess, IOException>() { @Override public PromotionProcess call() throws IOException { setOwner(owner); return getItem(name); } }); if (result == null) { throw new IOException("failed to load from " + configXml); } ItemListener.fireOnCreated(result); return result; } catch (IOException e) { Util.deleteRecursive(dir); throw e; } }
Items.whileUpdatingByXml(new NotReallyRoleSensitiveCallable<Void,IOException>() { @Override public Void call() throws IOException { onLoad(getParent(), getRootDir().getName());
Items.whileUpdatingByXml(new NotReallyRoleSensitiveCallable<Void, IOException>() { @SuppressWarnings("unchecked") @Override
TopLevelItem result = Items.whileUpdatingByXml(new NotReallyRoleSensitiveCallable<TopLevelItem,IOException>() { @Override public TopLevelItem call() throws IOException { return (TopLevelItem) Items.load(parent, dir);
/** * Reloads this job from the disk. * * Exposed through CLI as well. * * TODO: think about exposing this to UI * * @since 1.556 */ @RequirePOST public void doReload() throws IOException { checkPermission(CONFIGURE); // try to reflect the changes by reloading getConfigFile().unmarshal(this); Items.whileUpdatingByXml(new NotReallyRoleSensitiveCallable<Void, IOException>() { @Override public Void call() throws IOException { onLoad(getParent(), getRootDir().getName()); return null; } }); Jenkins.getInstance().rebuildDependencyGraphAsync(); SaveableListener.fireOnChange(this, getConfigFile()); }
result = Items.whileUpdatingByXml(new NotReallyRoleSensitiveCallable<T,IOException>() { @Override public T call() throws IOException { return (T) Items.load(parent, rootDir);