Java Code Examples for java.util.Map.Entry.getKey()

The following are Jave code examples for showing how to use getKey() of the java.util.Map.Entry class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: echidna   File: HTTPEncoder.java   View Source Code Vote up 6 votes
@Override
protected void encode(ChannelHandlerContext channelHandlerContext, HTTPResponse response,
	ByteBuf byteBuf) throws Exception {
	System.out.println("Response: " + response);
	
	String statusResponse = HTTP_VERSION + " "
		+ response.getStatus().getCode() + " "
		+ response.getStatus().getDescription() + new String(NEW_LINE);
	
	byteBuf.writeBytes(statusResponse.getBytes(CharsetUtil.UTF_8));
	
	for (Entry<String, String> entry : response.getHeaders().getHandle().entrySet()) {
		String line = entry.getKey() + ": " + entry.getValue();
		byteBuf.writeBytes(line.getBytes(CharsetUtil.UTF_8));
		byteBuf.writeBytes(NEW_LINE);
	}
	
	byteBuf.writeBytes(NEW_LINE);
	
	byteBuf.writeBytes(response.getBody().getHandle());
}
 
Example 2
Project: googles-monorepo-demo   File: MultimapRemoveEntryTester.java   View Source Code Vote up 6 votes
@MapFeature.Require(SUPPORTS_REMOVE)
@CollectionSize.Require(absent = ZERO)
public void testRemovePropagatesToAsMap() {
  List<Entry<K, V>> entries = Helpers.copyToList(multimap().entries());
  for (Entry<K, V> entry : entries) {
    resetContainer();

    K key = entry.getKey();
    V value = entry.getValue();
    Collection<V> collection = multimap().asMap().get(key);
    assertNotNull(collection);
    Collection<V> expectedCollection = Helpers.copyToList(collection);

    multimap().remove(key, value);
    expectedCollection.remove(value);

    assertEqualIgnoringOrder(expectedCollection, collection);
    assertEquals(!expectedCollection.isEmpty(), multimap().containsKey(key));
  }
}
 
Example 3
Project: rocketmq-rocketmq-all-4.1.0-incubating   File: RouteInfoManager.java   View Source Code Vote up 6 votes
public byte[] getUnitTopics() {
    TopicList topicList = new TopicList();
    try {
        try {
            this.lock.readLock().lockInterruptibly();
            Iterator<Entry<String, List<QueueData>>> topicTableIt =
                this.topicQueueTable.entrySet().iterator();
            while (topicTableIt.hasNext()) {
                Entry<String, List<QueueData>> topicEntry = topicTableIt.next();
                String topic = topicEntry.getKey();
                List<QueueData> queueDatas = topicEntry.getValue();
                if (queueDatas != null && queueDatas.size() > 0
                    && TopicSysFlag.hasUnitFlag(queueDatas.get(0).getTopicSynFlag())) {
                    topicList.getTopicList().add(topic);
                }
            }
        } finally {
            this.lock.readLock().unlock();
        }
    } catch (Exception e) {
        log.error("getAllTopicList Exception", e);
    }

    return topicList.encode();
}
 
Example 4
Project: freecol   File: StatisticsPanel.java   View Source Code Vote up 5 votes
/**
 * Gives this table model the data that is being used in the
 * table. This method should only be called to initialize the
 * data set. To modify or extend the data set use other
 * methods.
 *
 * @param statsData The map of key,value pairs to enter.
 */
public void setData(java.util.Map<String, String> statsData) {
    this.data = new Object[2][statsData.size()];
    int i = 0;
    for (Entry<String, String> e : mapEntriesByKey(statsData)) {
        data[NAME_COLUMN][i] = e.getKey();
        data[VALUE_COLUMN][i] = e.getValue();
        i++;
    }
}
 
Example 5
Project: sunbird-lms-mw   File: KeyCloakSyncActor.java   View Source Code Vote up 5 votes
private void updateUserDetails(Entry<String, Object> entry) {
  String userId = entry.getKey();
  ProjectLogger.log("updating user data started");
  Map<String, Object> userMap = (Map<String, Object>) entry.getValue();
  // Decrypt user data
  UserUtility.decryptUserData(userMap);
  Util.DbInfo dbInfo = Util.dbInfoMap.get(JsonKey.USER_DB);
  if(isSSOEnabled){
    try {
      String res = ssoManager.syncUserData(userMap);
      if (!(!ProjectUtil.isStringNullOREmpty(res) && res.equalsIgnoreCase(JsonKey.SUCCESS))) {
        if(null == userMap.get(JsonKey.EMAIL_VERIFIED)){
          Map<String,Object> map = new HashMap<>();
         if(SSOServiceFactory.getInstance().isEmailVerified(userId)){
           map.put(JsonKey.EMAIL_VERIFIED, true);
           map.put(JsonKey.ID, userId);
         }else{
           map.put(JsonKey.EMAIL_VERIFIED, false);
           map.put(JsonKey.ID, userId);
         }
         cassandraOperation.updateRecord(dbInfo.getKeySpace(), dbInfo.getTableName(), map);
         ElasticSearchUtil.updateData(ProjectUtil.EsIndex.sunbird.getIndexName(),
             ProjectUtil.EsType.user.getTypeName(), userId, map);
        }
        ProjectLogger.log("User sync failed in KeyCloakSyncActor for userID : "+ userId);
      }
    } catch (Exception e) {
      ProjectLogger.log(e.getMessage(), e);
      ProjectLogger.log("User sync failed in KeyCloakSyncActor for userID : "+ userId);
    }
  }else{
    ProjectLogger.log("SSO is disabled , cann't sync user data to keycloak.");
  }
}
 
Example 6
Project: GCSApp   File: ACache.java   View Source Code Vote up 5 votes
/**
 * 移除旧的文件
 * 
 * @return
 */
private long removeNext() {
	if (lastUsageDates.isEmpty()) {
		return 0;
	}

	Long oldestUsage = null;
	File mostLongUsedFile = null;
	Set<Entry<File, Long>> entries = lastUsageDates.entrySet();
	synchronized (lastUsageDates) {
		for (Entry<File, Long> entry : entries) {
			if (mostLongUsedFile == null) {
				mostLongUsedFile = entry.getKey();
				oldestUsage = entry.getValue();
			} else {
				Long lastValueUsage = entry.getValue();
				if (lastValueUsage < oldestUsage) {
					oldestUsage = lastValueUsage;
					mostLongUsedFile = entry.getKey();
				}
			}
		}
	}

	long fileSize = calculateSize(mostLongUsedFile);
	if (mostLongUsedFile.delete()) {
		lastUsageDates.remove(mostLongUsedFile);
	}
	return fileSize;
}
 
Example 7
Project: calendar-component   File: Calendar.java   View Source Code Vote up 5 votes
private List<CalendarState.Action> createActionsList(Map<CalendarDateRange, Set<Action>> actionMap) {

        if (actionMap.isEmpty()) {
            return null;
        }

        List<CalendarState.Action> calendarActions = new ArrayList<>();

        for (Entry<CalendarDateRange, Set<Action>> entry : actionMap.entrySet()) {

            CalendarDateRange range = entry.getKey();

            for (Action action : entry.getValue()) {
                String key = actionMapper.key(action);
                CalendarState.Action calendarAction = new CalendarState.Action();
                calendarAction.actionKey = key;
                calendarAction.caption = action.getCaption();
                setResource(key, action.getIcon());
                calendarAction.iconKey = key;
                calendarAction.startDate = ACTION_DATE_TIME_FORMAT.format(range.getStart());
                calendarAction.endDate = ACTION_DATE_TIME_FORMAT.format(range.getEnd());
                calendarActions.add(calendarAction);
            }
        }

        return calendarActions;
    }
 
Example 8
Project: OpenJSharp   File: VetoableChangeSupport.java   View Source Code Vote up 5 votes
/**
 * @serialData Null terminated list of <code>VetoableChangeListeners</code>.
 * <p>
 * At serialization time we skip non-serializable listeners and
 * only serialize the serializable listeners.
 */
private void writeObject(ObjectOutputStream s) throws IOException {
    Hashtable<String, VetoableChangeSupport> children = null;
    VetoableChangeListener[] listeners = null;
    synchronized (this.map) {
        for (Entry<String, VetoableChangeListener[]> entry : this.map.getEntries()) {
            String property = entry.getKey();
            if (property == null) {
                listeners = entry.getValue();
            } else {
                if (children == null) {
                    children = new Hashtable<>();
                }
                VetoableChangeSupport vcs = new VetoableChangeSupport(this.source);
                vcs.map.set(null, entry.getValue());
                children.put(property, vcs);
            }
        }
    }
    ObjectOutputStream.PutField fields = s.putFields();
    fields.put("children", children);
    fields.put("source", this.source);
    fields.put("vetoableChangeSupportSerializedDataVersion", 2);
    s.writeFields();

    if (listeners != null) {
        for (VetoableChangeListener l : listeners) {
            if (l instanceof Serializable) {
                s.writeObject(l);
            }
        }
    }
    s.writeObject(null);
}
 
Example 9
Project: hadoop   File: CapacitySchedulerConfiguration.java   View Source Code Vote up 5 votes
/**
 * Get configured node labels in a given queuePath
 */
public Set<String> getConfiguredNodeLabels(String queuePath) {
  Set<String> configuredNodeLabels = new HashSet<String>();
  Entry<String, String> e = null;
  
  Iterator<Entry<String, String>> iter = iterator();
  while (iter.hasNext()) {
    e = iter.next();
    String key = e.getKey();

    if (key.startsWith(getQueuePrefix(queuePath) + ACCESSIBLE_NODE_LABELS
        + DOT)) {
      // Find <label-name> in
      // <queue-path>.accessible-node-labels.<label-name>.property
      int labelStartIdx =
          key.indexOf(ACCESSIBLE_NODE_LABELS)
              + ACCESSIBLE_NODE_LABELS.length() + 1;
      int labelEndIndx = key.indexOf('.', labelStartIdx);
      String labelName = key.substring(labelStartIdx, labelEndIndx);
      configuredNodeLabels.add(labelName);
    }
  }
  
  // always add NO_LABEL
  configuredNodeLabels.add(RMNodeLabelsManager.NO_LABEL);
  
  return configuredNodeLabels;
}
 
Example 10
Project: GitHub   File: ACache.java   View Source Code Vote up 5 votes
/**
 * 移除旧的文件
 */
private long removeNext() {
    if (lastUsageDates.isEmpty()) {
        return 0;
    }

    Long oldestUsage = null;
    File mostLongUsedFile = null;
    Set<Entry<File, Long>> entries = lastUsageDates.entrySet();
    synchronized (lastUsageDates) {
        for (Entry<File, Long> entry : entries) {
            if (mostLongUsedFile == null) {
                mostLongUsedFile = entry.getKey();
                oldestUsage = entry.getValue();
            } else {
                Long lastValueUsage = entry.getValue();
                if (lastValueUsage < oldestUsage) {
                    oldestUsage = lastValueUsage;
                    mostLongUsedFile = entry.getKey();
                }
            }
        }
    }

    long fileSize = calculateSize(mostLongUsedFile);
    if (mostLongUsedFile.delete()) {
        lastUsageDates.remove(mostLongUsedFile);
    }
    return fileSize;
}
 
Example 11
Project: hadoop   File: ValueHistogram.java   View Source Code Vote up 5 votes
/**
 *  @return a list value/frequence pairs.
 *  The return value is expected to be used by the reducer.
 */
public ArrayList<String> getCombinerOutput() {
  ArrayList<String> retv = new ArrayList<String>();
  Iterator<Entry<Object,Object>> iter = items.entrySet().iterator();

  while (iter.hasNext()) {
    Entry<Object,Object> en =  iter.next();
    Object val = en.getKey();
    Long count = (Long) en.getValue();
    retv.add(val.toString() + "\t" + count.longValue());
  }
  return retv;
}
 
Example 12
Project: L2J-Global   File: DispelBySlot.java   View Source Code Vote up 5 votes
@Override
public void instant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
	if (_dispelAbnormals.isEmpty())
	{
		return;
	}
	
	final CharEffectList effectList = effected.getEffectList();
	// There is no need to iterate over all buffs,
	// Just iterate once over all slots to dispel and get the buff with that abnormal if exists,
	// Operation of O(n) for the amount of slots to dispel (which is usually small) and O(1) to get the buff.
	for (Entry<AbnormalType, Short> entry : _dispelAbnormals.entrySet())
	{
		// Dispel transformations (buff and by GM)
		if ((entry.getKey() == AbnormalType.TRANSFORM))
		{
			if ((entry.getValue() == effected.getTransformationId()) || (entry.getValue() < 0))
			{
				effected.stopTransformation(true);
				continue;
			}
		}
		
		final BuffInfo toDispel = effectList.getBuffInfoByAbnormalType(entry.getKey());
		if (toDispel == null)
		{
			continue;
		}
		
		if ((entry.getKey() == toDispel.getSkill().getAbnormalType()) && ((entry.getValue() < 0) || (entry.getValue() >= toDispel.getSkill().getAbnormalLvl())))
		{
			effectList.stopSkillEffects(true, entry.getKey());
		}
	}
}
 
Example 13
Project: similarity-uniform-fuzzy-hash   File: UniformFuzzyHashes.java   View Source Code Vote up 5 votes
/**
 * Rebuilds a map of identified Uniform Fuzzy Hashes from a map of identified strings
 * representing them.
 * 
 * @param <T> Identifiers type.
 * @param strings Map of identified strings representing Uniform Fuzzy Hashes.
 * @return Map of identified Uniform Fuzzy Hashes.
 */
public static <T> Map<T, UniformFuzzyHash> rebuildHashesFromStrings(
        Map<T, String> strings) {

    if (strings == null) {
        throw new NullPointerException("Map of hash strings is null.");
    }

    Set<Entry<T, String>> entries = strings.entrySet();
    Map<T, UniformFuzzyHash> hashes = new LinkedHashMap<>(entries.size());

    for (Entry<T, String> entry : entries) {

        T identifier = entry.getKey();
        String hashString = entry.getValue();

        if (hashString == null) {
            hashes.put(identifier, null);
            continue;
        }

        UniformFuzzyHash hash = null;
        try {
            hash = UniformFuzzyHash.rebuildFromString(hashString);
        } catch (IllegalArgumentException illegalArgumentException) {
            throw new IllegalArgumentException(String.format(
                    "Hash %s could not be parsed. %s",
                    identifier,
                    illegalArgumentException.getMessage()));
        }
        hashes.put(identifier, hash);

    }

    return hashes;

}
 
Example 14
Project: incubator-netbeans   File: PublicPackagesPanel.java   View Source Code Vote up 5 votes
/**
 * Transforms public packages in form of "selected items" map into
 * set of strings describing public packages in maven-nbm-plugin syntax.
 */
public static SortedSet<String> getPublicPackagesForPlugin (SortedMap<String, Boolean> selItems) {
    SortedSet<String> result = new TreeSet<String>();
    Set<String> processed = new HashSet<String>();
    for (Entry<String, Boolean> entry : selItems.entrySet()) {
        if (entry.getValue() && !processed.contains(entry.getKey())) {
            boolean allSubpackages = true;
            Set<String> processedCandidates = new HashSet<String>();
            String prefix = entry.getKey() + ".";
            for (String key : selItems.keySet()) {
                if (key.startsWith(prefix)) {
                    if (selItems.get(key)) {
                        processedCandidates.add(key);
                    } else {
                        allSubpackages = false;
                        break;
                    }
                }
            }
            if (allSubpackages && processedCandidates.size() > COALESCE_LIMIT) {
                result.add(entry.getKey() + ALL_SUBPACKAGES);
                processed.addAll(processedCandidates);
            } else {
                result.add(entry.getKey());
            }
        }
    }

    return result;
}
 
Example 15
Project: WirelessRedstone   File: RedstoneEtherFrequency.java   View Source Code Vote up 5 votes
public void updateAllReceivers()
{
    ((RedstoneEtherServer)ether).updateReceivingDevices(freq, powered);
    
    for(Entry<Integer, DimensionalNodeTracker> entry : nodetrackers.entrySet())
    {
        int dimension = entry.getKey();
        DimensionalNodeTracker tracker = entry.getValue();
        
        useTemporarySet = true;
        for(BlockPos coord : tracker.receiverset)
        {
            updateReceiver(tracker.world, coord, powered);
        }
        useTemporarySet = false;
        
        while(tracker.temporarySet.size() > 0)
        {
            DelayedModification mod = tracker.temporarySet.removeFirst();
            
            if(mod.function == 0)
                remReceiver(tracker.world, mod.coord, dimension);
            else if(mod.function == 1)
                addReceiver(tracker.world, mod.coord, dimension);
            else if(mod.function == 2)
                remTransmitter(tracker.world, mod.coord, dimension);
            else if((mod.function&4)!= 0)
                setTransmitter(tracker.world, mod.coord, dimension, (mod.function&1) != 0);
        }
    }
}
 
Example 16
Project: empiria.player   File: VisiblePagesManager.java   View Source Code Vote up 5 votes
private Set<Integer> getActivePagesIds() {
    Map<Integer, KeyValue<FlowPanel, FlowPanel>> cache = panelCache.getCache();
    Set<Integer> activePanels = Sets.newHashSet();
    for (Entry<Integer, KeyValue<FlowPanel, FlowPanel>> entry : cache.entrySet()) {
        Integer key = entry.getKey();
        KeyValue<FlowPanel, FlowPanel> value = entry.getValue();
        if (value.getValue().isAttached()) {
            activePanels.add(key);
        }
    }
    return activePanels;
}
 
Example 17
Project: calcite-avatica   File: KerberosConnection.java   View Source Code Vote up 5 votes
/**
 * Logout and log back in with the Kerberos identity.
 */
void renew() {
  try {
    // Lock on the instance of KerberosUtil
    synchronized (utilInstance) {
      Entry<LoginContext, Subject> pair = utilInstance.login(context, conf, subject);
      context = pair.getKey();
      subject = pair.getValue();
    }
  } catch (Exception e) {
    throw new RuntimeException("Failed to perform kerberos login");
  }
}
 
Example 18
Project: Infernum   File: InfernalMonumentGenerator.java   View Source Code Vote up 4 votes
public void generateMonument(WorldServer world, BlockPos pos, Random rand) {
	MinecraftServer server = world.getMinecraftServer();
	Template template = world.getStructureTemplateManager().getTemplate(server, MONUMENT_STRUCTURE);
	PlacementSettings settings = new PlacementSettings();
	settings.setRotation(Rotation.values()[rand.nextInt(Rotation.values().length)]);
	
	BlockPos size = template.getSize();
	int airBlocks = 0;
	for(int x = 0; x < size.getX(); x++) {
		for (int z = 0; z < size.getZ(); z++) {
			if (world.isAirBlock(pos.add(template.transformedBlockPos(settings, new BlockPos(x, -1, z))))) {
				airBlocks++;
				if (airBlocks > 0.33 * (size.getX() * size.getZ())) {
					return;
				}
			}
		}
	}
	for (int x = 0; x < size.getX(); x++) {
		for (int z = 0; z < size.getZ(); z++) {
			if (x == 0 || x == size.getX() - 1 || z == 0 || z == size.getZ() - 1) {
				for (int y = 0; y < size.getY(); y++) {
					BlockPos checkPos = pos.add(template.transformedBlockPos(settings, new BlockPos(x, y, z)));
					IBlockState checkState = world.getBlockState(checkPos);
					if (!checkState.getBlock().isAir(checkState, world, checkPos)) {
						if (!(y <= 0 && (checkState.getBlock() == Blocks.NETHERRACK || checkState.getBlock() == Blocks.QUARTZ_ORE || checkState.getBlock() == Blocks.MAGMA))) {
							return;
						}
					}
				}
			}
		}
	}

	template.addBlocksToWorld(world, pos, settings);

	Map<BlockPos, String> dataBlocks = template.getDataBlocks(pos, settings);
	for (Entry<BlockPos, String> entry : dataBlocks.entrySet()) {
		String[] tokens = entry.getValue().split(" ");
		if (tokens.length == 0)
			return;

		BlockPos dataPos = entry.getKey();

		if (tokens[0].equals("pedestal")) {
			IBlockState chestState = InfernumBlocks.PEDESTAL.getDefaultState();
			world.setBlockState(dataPos, chestState);
			TileEntity tile = world.getTileEntity(dataPos);
			if (tile instanceof TilePedestal) {
				((TilePedestal) tile).setStack(new ItemStack(InfernumItems.KNOWLEDGE_BOOK));
			}
		}

	}

}
 
Example 19
Project: hadoop   File: ShortCircuitCache.java   View Source Code Vote up 4 votes
/**
 * Run the CacheCleaner thread.
 *
 * Whenever a thread requests a ShortCircuitReplica object, we will make
 * sure it gets one.  That ShortCircuitReplica object can then be re-used
 * when another thread requests a ShortCircuitReplica object for the same
 * block.  So in that sense, there is no maximum size to the cache.
 *
 * However, when a ShortCircuitReplica object is unreferenced by the
 * thread(s) that are using it, it becomes evictable.  There are two
 * separate eviction lists-- one for mmaped objects, and another for
 * non-mmaped objects.  We do this in order to avoid having the regular
 * files kick the mmaped files out of the cache too quickly.  Reusing
 * an already-existing mmap gives a huge performance boost, since the
 * page table entries don't have to be re-populated.  Both the mmap
 * and non-mmap evictable lists have maximum sizes and maximum lifespans.
 */
@Override
public void run() {
  ShortCircuitCache.this.lock.lock();
  try {
    if (ShortCircuitCache.this.closed) return;
    long curMs = Time.monotonicNow();

    if (LOG.isDebugEnabled()) {
      LOG.debug(this + ": cache cleaner running at " + curMs);
    }

    int numDemoted = demoteOldEvictableMmaped(curMs);
    int numPurged = 0;
    Long evictionTimeNs = Long.valueOf(0);
    while (true) {
      Entry<Long, ShortCircuitReplica> entry = 
          evictable.ceilingEntry(evictionTimeNs);
      if (entry == null) break;
      evictionTimeNs = entry.getKey();
      long evictionTimeMs = 
          TimeUnit.MILLISECONDS.convert(evictionTimeNs, TimeUnit.NANOSECONDS);
      if (evictionTimeMs + maxNonMmappedEvictableLifespanMs >= curMs) break;
      ShortCircuitReplica replica = entry.getValue();
      if (LOG.isTraceEnabled()) {
        LOG.trace("CacheCleaner: purging " + replica + ": " + 
              StringUtils.getStackTrace(Thread.currentThread()));
      }
      purge(replica);
      numPurged++;
    }

    if (LOG.isDebugEnabled()) {
      LOG.debug(this + ": finishing cache cleaner run started at " +
        curMs + ".  Demoted " + numDemoted + " mmapped replicas; " +
        "purged " + numPurged + " replicas.");
    }
  } finally {
    ShortCircuitCache.this.lock.unlock();
  }
}
 
Example 20
Project: GitHub   File: HurlStack.java   View Source Code Vote up 4 votes
@Override
public HttpResponse performRequest(Request<?> request, Map<String, String> additionalHeaders)
        throws IOException, AuthFailureError {
    String url = request.getUrl();
    HashMap<String, String> map = new HashMap<String, String>();
    map.putAll(request.getHeaders());
    map.putAll(additionalHeaders);
    if (mUrlRewriter != null) {
        String rewritten = mUrlRewriter.rewriteUrl(url);
        if (rewritten == null) {
            throw new IOException("URL blocked by rewriter: " + url);
        }
        url = rewritten;
    }
    URL parsedUrl = new URL(url);
    HttpURLConnection connection = openConnection(parsedUrl, request);
    for (String headerName : map.keySet()) {
        connection.addRequestProperty(headerName, map.get(headerName));
    }
    setConnectionParametersForRequest(connection, request);
    // Initialize HttpResponse with data from the HttpURLConnection.
    ProtocolVersion protocolVersion = new ProtocolVersion("HTTP", 1, 1);
    int responseCode = connection.getResponseCode();
    if (responseCode == -1) {
        // -1 is returned by getResponseCode() if the response code could not be retrieved.
        // Signal to the caller that something was wrong with the connection.
        throw new IOException("Could not retrieve response code from HttpUrlConnection.");
    }
    StatusLine responseStatus = new BasicStatusLine(protocolVersion,
            connection.getResponseCode(), connection.getResponseMessage());
    BasicHttpResponse response = new BasicHttpResponse(responseStatus);
    if (hasResponseBody(request.getMethod(), responseStatus.getStatusCode())) {
        response.setEntity(entityFromConnection(connection));
    }
    for (Entry<String, List<String>> header : connection.getHeaderFields().entrySet()) {
        if (header.getKey() != null) {
            Header h = new BasicHeader(header.getKey(), header.getValue().get(0));
            response.addHeader(h);
        }
    }
    return response;
}